deploy_archives.sh 599 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. set -ex
  3. if [ "$CI_BUILD_REF_NAME" != "$CI_BUILD_TAG" ]; then
  4. echo 'deploy archives only for tag releases'
  5. exit 0
  6. fi
  7. # cleanup
  8. contrib/cleanup.sh
  9. ( find . -type d -name ".git" \
  10. && find . -name ".gitignore" \
  11. && find . -name ".gitkeep" \
  12. && find . -name ".gitmodules" ) | xargs rm -rf
  13. # tar.gz
  14. tar -czf /tmp/zammad-${CI_BUILD_TAG}.tar.gz .
  15. # tar.bz2
  16. tar -cjf /tmp/zammad-${CI_BUILD_TAG}.tar.bz2 .
  17. # zip
  18. zip -r /tmp/zammad-${CI_BUILD_TAG}.zip ./*
  19. # publish
  20. scp /tmp/zammad-${CI_BUILD_TAG}.tar.* $ARCHIVE_SCP_TARGET
  21. scp /tmp/zammad-${CI_BUILD_TAG}.zip $ARCHIVE_SCP_TARGET