2017-12-14 07:03:59 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2020-02-24 10:08:59 +08:00
|
|
|
echo "Version: ${VERSION}"
|
|
|
|
echo "Full Version: ${FULL_VERSION}"
|
|
|
|
echo "Package name: ${TAR_NAME}"
|
2021-01-17 09:25:58 +08:00
|
|
|
echo "Current directory: ${BASE_DIR}"
|
2020-02-12 02:25:54 +08:00
|
|
|
|
|
|
|
echo "Cleaning files"
|
|
|
|
|
|
|
|
# Leftover individual files to delete
|
|
|
|
declare -a remove_files=(
|
|
|
|
.git
|
|
|
|
.github
|
|
|
|
.sass-cache
|
|
|
|
.idea
|
|
|
|
.travis
|
|
|
|
docker
|
2022-02-09 00:12:39 +08:00
|
|
|
node_modules
|
|
|
|
vendor/willdurand/geocoder/tests
|
2020-02-12 02:25:54 +08:00
|
|
|
_ide_helper.php
|
2022-02-09 00:12:39 +08:00
|
|
|
.env
|
2020-02-12 02:25:54 +08:00
|
|
|
.dockerignore
|
|
|
|
.dpl
|
|
|
|
.editorconfig
|
|
|
|
.eslintignore
|
|
|
|
.eslintrc
|
|
|
|
.php_cs
|
|
|
|
.php_cs.cache
|
2021-12-03 22:23:59 +08:00
|
|
|
.php-cs-fixer.php
|
2020-02-12 02:25:54 +08:00
|
|
|
.phpstorm.meta.php
|
|
|
|
.styleci.yml
|
|
|
|
.phpunit.result.cache
|
|
|
|
env.php
|
|
|
|
intellij_style.xml
|
|
|
|
config.php
|
|
|
|
docker-compose.yml
|
2021-05-26 03:07:04 +08:00
|
|
|
docker-compose.local.yml
|
2020-02-12 02:25:54 +08:00
|
|
|
Makefile
|
|
|
|
phpcs.xml
|
|
|
|
phpunit.xml
|
|
|
|
phpvms.iml
|
|
|
|
Procfile
|
|
|
|
phpstan.neon
|
2022-02-09 00:12:39 +08:00
|
|
|
symfony.lock
|
2020-02-12 02:25:54 +08:00
|
|
|
composer.phar
|
|
|
|
)
|
|
|
|
|
|
|
|
for file in "${remove_files[@]}"; do
|
|
|
|
rm -rf $file
|
|
|
|
done
|
|
|
|
|
|
|
|
find ./vendor -type d -name ".git" -print0 | xargs rm -rf
|
|
|
|
find . -type d -name "sass-cache" -print0 | xargs rm -rf
|
|
|
|
|
|
|
|
# clear any app specific stuff that might have been loaded in
|
|
|
|
find bootstrap/cache -mindepth 1 -maxdepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
|
|
|
|
find storage/app -mindepth 1 -maxdepth 1 -not -name '.gitignore' -not -name public -not -name import -print0 -exec rm -rf {} +
|
|
|
|
find storage/app/public -mindepth 1 -maxdepth 1 -not -name '.gitignore' -not -name avatars -not -name uploads -print0 -exec rm -rf {} +
|
|
|
|
find storage/app/public/avatars -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
|
|
|
|
find storage/app/public/uploads -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
|
|
|
|
find storage/debugbar -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
|
|
|
|
find storage/docker -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
|
|
|
|
find storage/framework/cache -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
|
|
|
|
find storage/framework/sessions -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
|
|
|
|
find storage/framework/views -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
|
|
|
|
find storage/logs -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
|
|
|
|
|
|
|
|
mkdir -p storage/app/public/avatars
|
|
|
|
mkdir -p storage/app/public/uploads
|
|
|
|
mkdir -p storage/framework/cache
|
|
|
|
mkdir -p storage/framework/sessions
|
|
|
|
mkdir -p storage/framework/views
|
|
|
|
|
|
|
|
cd /tmp
|
|
|
|
|
2021-08-07 23:34:06 +08:00
|
|
|
echo "Current directory contents"
|
|
|
|
ls -al $BASE_DIR
|
|
|
|
|
|
|
|
echo "Parent directory contents"
|
2021-01-17 09:25:58 +08:00
|
|
|
ls -al $BASE_DIR/../
|
|
|
|
|
2021-08-07 23:34:06 +08:00
|
|
|
echo "Calling find"
|
|
|
|
find $BASE_DIR/../ -type d -maxdepth 2
|
|
|
|
|
2021-08-08 00:51:13 +08:00
|
|
|
tar -czf $TAR_NAME -C $BASE_DIR --xform 's:^\./::' . [--show-transformed-names|--show-stored-names]
|
2020-02-12 02:25:54 +08:00
|
|
|
sha256sum $TAR_NAME >"$TAR_NAME.sha256"
|
2021-06-10 04:22:25 +08:00
|
|
|
|
2021-08-08 00:16:16 +08:00
|
|
|
cd $BASE_DIR;
|
|
|
|
zip -r $ZIP_NAME ./
|
2020-02-12 02:25:54 +08:00
|
|
|
sha256sum $ZIP_NAME >"$ZIP_NAME.sha256"
|
2021-08-08 00:24:15 +08:00
|
|
|
|
2021-06-10 04:22:25 +08:00
|
|
|
mv $ZIP_NAME /tmp
|
|
|
|
mv "$ZIP_NAME.sha256" /tmp
|
2020-02-12 02:25:54 +08:00
|
|
|
|
|
|
|
ls -al /tmp
|
|
|
|
|
2021-01-17 09:25:58 +08:00
|
|
|
echo "Moving to dist"
|
|
|
|
mkdir -p $BASE_DIR/dist
|
|
|
|
cd $BASE_DIR/dist
|
2020-02-12 02:25:54 +08:00
|
|
|
|
|
|
|
mv "/tmp/$TAR_NAME" "/tmp/$ZIP_NAME" "/tmp/$TAR_NAME.sha256" "/tmp/$ZIP_NAME.sha256" .
|
|
|
|
|