Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit e8be637

Browse files
committed
Added scripts to generate package; refs #43659
1 parent 3e13c46 commit e8be637

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

202/docker/package.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
3+
set +ex
4+
5+
ls -la
6+
cd modules/axeptiocookies
7+
8+
php -v | grep 5.6 && echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list
9+
php -v | grep 5.6 && echo "deb-src http://archive.debian.org/debian stretch main" >> /etc/apt/sources.list
10+
php -v | grep 5.6 && echo "deb http://archive.debian.org/debian stretch-backports main" >> /etc/apt/sources.list
11+
php -v | grep 5.6 && echo "deb-src http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list
12+
apt-get update && apt-get install wget git zip unzip xmlstarlet -y
13+
wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
14+
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
15+
php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
16+
php composer-setup.php
17+
php -r "unlink('composer-setup.php'); unlink('installer.sig');"
18+
19+
CI_PROJECT_NAME=axeptiocookies
20+
CI_PROJECT_DIR=/var/www/html/modules/axeptiocookies
21+
MODULE_VERSION=$(xmlstarlet sel -t -v '/project/property[@name="TARGETVERSION"]/@value' 202/build.xml)
22+
find ./ -type f -exec sed -i "s/@version@/$MODULE_VERSION/g" {} +
23+
php composer.phar global require prestashop/autoindex
24+
~/.composer/vendor/bin/autoindex --exclude=202
25+
rm -f composer.lock
26+
find ./vendor -mindepth 1 ! -regex '^./vendor/totpsclasslib\(/.*\)?' -delete
27+
php composer.phar remove phpstan/phpstan phpunit/phpunit prestashop/php-dev-tools prestashop/header-stamp --no-progress --dev --no-install --no-update
28+
php composer.phar install --no-dev --optimize-autoloader --classmap-authoritative
29+
rm 202 node_modules composer.* node_modules _dev .git tests var -Rf
30+
rm docker-compose.yml browserlist .stylelintignore .editorconfig babel.config.js webpack.config.js postcss.config.js cache.properties sonar-project.properties config_fr.xml composer.json composer.lock composer.phar .gitignore .browserlistrc .eslintrc.js .postcssrc.js babel.config.js vue.config.js package.json package-lock.json .php-cs-fixer.dist.php .php_cs.cache .php-cs-fixer.cache .gitlab-ci.yml before_autoload.sh Makefile Readme.md views/_dev -Rf
31+
[ -d ../../packages ] || mkdir ../../packages
32+
rm -Rf ../../packages/$CI_PROJECT_NAME
33+
mkdir ../../packages/$CI_PROJECT_NAME
34+
cd ../
35+
zip -9 -r -q --exclude=\*.DS_Store\* --exclude=\*._.DS_Store\* --exclude=\*__MACOSX\* --exclude=\*.buildpath\* --exclude=\*.dropbox\* --exclude=\*.git\* --exclude=\*.idea\* --exclude=\*.project\* --exclude=\*.sass-cache\* --exclude=\*.settings\* --exclude=\*.svn\* --exclude=\*config.codekit\* --exclude=\*desktop.ini\* --exclude=\*nbproject\* --exclude=\*.log --exclude=$CI_PROJECT_NAME/config.xml --exclude=$CI_PROJECT_NAME/config_\*.xml $CI_PROJECT_DIR/../../packages/$CI_PROJECT_NAME/$CI_PROJECT_NAME.zip ./$CI_PROJECT_NAME
36+
cd $CI_PROJECT_DIR/../../packages/$CI_PROJECT_NAME
37+
unzip $CI_PROJECT_NAME.zip
38+
cd $CI_PROJECT_DIR/../../packages/$CI_PROJECT_NAME/$CI_PROJECT_NAME
39+
find . -type f -exec md5sum "{}" + > ../$CI_PROJECT_NAME.md5
40+
cd $CI_PROJECT_DIR/../../packages/$CI_PROJECT_NAME
41+
rm -Rf $CI_PROJECT_DIR
42+
mkdir $CI_PROJECT_DIR
43+
cp *.zip $CI_PROJECT_DIR
44+
cp *.md5 $CI_PROJECT_DIR

202/docker/run_package.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
echo "Removing container axeptiocookies-ps-56 with image prestashop/prestashop:1.7.6.9-5.6"
3+
docker rm -f axeptiocookies-ps-56
4+
echo "Running container axeptiocookies-ps-56 with image prestashop/prestashop:1.7.6.9-5.6"
5+
docker run -tid --rm -v ps-volume-axeptiocookies-ps-56:/var/www/html --name axeptiocookies-ps-56 prestashop/prestashop:1.7.6.9-5.6
6+
echo "Exec remove module directory axeptiocookies in container"
7+
docker exec -t axeptiocookies-ps-56 rm -rf /var/www/html/modules/axeptiocookies
8+
docker cp $PWD/../../ axeptiocookies-ps-56:/var/www/html/modules/axeptiocookies
9+
echo "Run packaging Inside Container in /var/www/html/modules/axeptiocookies"
10+
docker exec -t axeptiocookies-ps-56 bash -c /var/www/html/modules/axeptiocookies/202/docker/package.sh
11+
docker cp axeptiocookies-ps-56:/var/www/html/packages $PWD

0 commit comments

Comments
 (0)