diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 31dd9a050..a667ceaf8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,7 @@ stages: - pre - test - browser + - deploy pre:rubocop: stage: pre @@ -1001,3 +1002,12 @@ test:browser:integration:zendesk_chrome: - 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 - 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 diff --git a/script/build/deploy_archives.sh b/script/build/deploy_archives.sh new file mode 100644 index 000000000..a22818ab2 --- /dev/null +++ b/script/build/deploy_archives.sh @@ -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