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
|
|
|
|
contrib/cleanup.sh
|
|
|
|
|
|
|
|
( 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
|
|
|
|
zip /tmp/zammad-${CI_BUILD_TAG}.zip ./*
|
|
|
|
|
|
|
|
# publish
|
|
|
|
scp /tmp/zammad-${CI_BUILD_TAG}.tar.* $ARCHIVE_SCP_TARGET
|
|
|
|
scp /tmp/zammad-${CI_BUILD_TAG}.zip $ARCHIVE_SCP_TARGET
|