-
Notifications
You must be signed in to change notification settings - Fork 2
/
packlink-build.sh
executable file
·47 lines (38 loc) · 1.33 KB
/
packlink-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
set -e
GREEN='\033[0;32m'
NOCOLOR='\033[0m'
# Cleanup any leftovers
echo -e "${GREEN}Cleaning up...${NOCOLOR}"
rm -rf ./Packlink.zip
rm -rf ./build
# Create deployment source
echo -e "${GREEN}STEP 1:${NOCOLOR} Copying plugin source..."
mkdir build
cp -R ./Packlink ./build/Packlink
echo -e "${GREEN}STEP 2:${NOCOLOR} Installing composer dependencies..."
cd build/Packlink
rm -rf vendor
composer install --no-dev
cd ../..
# Remove unnecessary files from final release archive
echo -e "${GREEN}STEP 3:${NOCOLOR} Removing unnecessary files from final release archive..."
rm -rf build/Packlink/Lib
rm -rf build/Packlink/Tests
rm -rf build/Packlink/phpunit.xml
rm -rf build/Packlink/Resources/views/backend/_resources/packlink/countries/fromCSV.php
rm -rf build/Packlink/Resources/views/backend/_resources/packlink/countries/toCSV.php
rm -rf build/Packlink/BusinessLogic/Resources/countries/fromCSV.php
rm -rf build/Packlink/BusinessLogic/Resources/countries/toCSV.php
# Core is now part of the integration
rm -rf build/Packlink/vendor/packlink
rm -rf build/Packlink/composer.json
rm -rf build/Packlink/composer.lock
rm -rf build/Packlink/integrate-core.sh
# Create plugin archive
echo -e "${GREEN}STEP 4:${NOCOLOR} Creating new archive..."
cd build/
zip -r -q Packlink.zip Packlink/
cd ../
cp build/Packlink.zip Packlink.zip
rm build/Packlink.zip