Added deployment of archives.

This commit is contained in:
Thorsten Eckel 2016-09-07 15:27:17 +02:00
parent 02e39e092d
commit 2ae3a726fc
2 changed files with 39 additions and 0 deletions

View file

@ -9,6 +9,7 @@ stages:
- pre - pre
- test - test
- browser - browser
- deploy
pre:rubocop: pre:rubocop:
stage: pre stage: pre
@ -1001,3 +1002,12 @@ test:browser:integration:zendesk_chrome:
- script/build/test_startup.sh $RAILS_ENV $BROWSER_PORT $WS_PORT 1 - script/build/test_startup.sh $RAILS_ENV $BROWSER_PORT $WS_PORT 1
- ruby -I test/ test/integration/zendesk_import_browser_test.rb || script/build/test_shutdown.sh $RAILS_ENV $BROWSER_PORT $WS_PORT 1 1 - ruby -I test/ test/integration/zendesk_import_browser_test.rb || script/build/test_shutdown.sh $RAILS_ENV $BROWSER_PORT $WS_PORT 1 1
- script/build/test_shutdown.sh $RAILS_ENV $BROWSER_PORT $WS_PORT 0 1 - script/build/test_shutdown.sh $RAILS_ENV $BROWSER_PORT $WS_PORT 0 1
deploy:archives:
stage: deploy
tags:
- deploy
only:
- tags
script:
- script/build/deploy_archives.sh

View file

@ -0,0 +1,29 @@
#!/bin/bash
set -ex
if ! echo $CI_BUILD_REF_NAME | grep stable-; then
echo 'deploy archives only for stable branches'
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