2016-09-07 13:27:17 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2016-10-19 05:31:46 +00:00
|
|
|
if [ "$CI_BUILD_REF_NAME" != "$CI_BUILD_TAG" ]; then
|
|
|
|
echo 'deploy archives only for tag releases'
|
2016-09-07 13:27:17 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# cleanup
|
2018-05-10 10:51:19 +00:00
|
|
|
cleanup.sh
|
2016-09-07 13:27:17 +00:00
|
|
|
|
|
|
|
( find . -type d -name ".git" \
|
|
|
|
&& find . -name ".gitignore" \
|
|
|
|
&& find . -name ".gitkeep" \
|
|
|
|
&& find . -name ".gitmodules" ) | xargs rm -rf
|
|
|
|
|
|
|
|
# tar.gz
|
|
|
|
tar -czf /tmp/zammad-${CI_BUILD_TAG}.tar.gz .
|
|
|
|
|
|
|
|
# tar.bz2
|
|
|
|
tar -cjf /tmp/zammad-${CI_BUILD_TAG}.tar.bz2 .
|
|
|
|
|
|
|
|
# zip
|
2016-10-19 06:25:51 +00:00
|
|
|
zip -r /tmp/zammad-${CI_BUILD_TAG}.zip ./*
|
2016-09-07 13:27:17 +00:00
|
|
|
|
|
|
|
# publish
|
|
|
|
scp /tmp/zammad-${CI_BUILD_TAG}.tar.* $ARCHIVE_SCP_TARGET
|
|
|
|
scp /tmp/zammad-${CI_BUILD_TAG}.zip $ARCHIVE_SCP_TARGET
|