forked from packlink-dev/prestashop_module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpacklink-build.sh
executable file
·52 lines (45 loc) · 1.77 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
48
49
50
51
52
#!/bin/bash
set -e
# Create deployment source
echo "\e[32mSTEP 1:\e[0m Copying plugin source..."
mkdir packlink
cp -r ./src/* packlink
# Ensure proper composer dependencies
echo "\e[32mSTEP 2:\e[0m Installing composer dependencies..."
cd packlink
# remove resources that will be copied from the core in the post-install script
rm -rf views/img/carriers/de/*
rm -rf views/img/carriers/es/*
rm -rf views/img/carriers/fr/*
rm -rf views/img/carriers/it/*
rm -rf views/js/core
rm -rf views/js/location
rm -rf vendor
# add version to artifact
echo "$1" > release.version
composer install --no-dev
cd .. || exit
# Remove unnecessary files from final release archive
echo "\e[32mSTEP 3:\e[0m Removing unnecessary files from final release archive..."
rm -rf packlink/lib
rm -rf packlink/tests
rm -rf packlink/phpunit.xml
rm -rf packlink/config.xml
rm -rf packlink/deploy.sh
rm -rf packlink/views/css/.gitignore
rm -rf packlink/views/img/carriers/.gitignore
rm -rf packlink/vendor/packlink/integration-core/.git
rm -rf packlink/vendor/packlink/integration-core/.gitignore
rm -rf packlink/vendor/packlink/integration-core/.idea
rm -rf packlink/vendor/packlink/integration-core/tests
rm -rf packlink/vendor/packlink/integration-core/generic_tests
rm -rf packlink/vendor/packlink/integration-core/README.md
rm -rf packlink/vendor/setasign/fpdf/tutorial/
echo "\e[32mSTEP 4:\e[0m Adding PrestaShop mandatory licence header to files..."
php "$PWD/src/lib/autoLicence.php" "$PWD/packlink"
# Adding PrestaShop mandatory index.php file to all folders
echo "\e[32mSTEP 5:\e[0m Adding PrestaShop mandatory index.php file to all folders..."
php "$PWD/lib/autoindex/index.php" "$PWD/packlink" >/dev/null
# Create plugin archive
echo "\e[32mSTEP 6:\e[0m Creating new archive... artifact.zip"
zip -r -q artifact.zip ./packlink