From 312e71d3ec00b53ac626b771501112f5cdfd40e5 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 18 Oct 2021 14:46:04 +0200 Subject: [PATCH] Compress the CI release artifacts before passing to upload Signed-off-by: Thomas Citharel --- .gitlab-ci.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 99c62b073..f2e1da2cb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -210,14 +210,19 @@ package-app: stage: package variables: &release-variables MIX_ENV: "prod" + APP_VERSION: "${CI_COMMIT_TAG}" + APP_ASSET: "${CI_PROJECT_NAME}_${APP_VERSION}_${ARCH}.tar.gz" script: &release-script - mix local.hex --force - mix local.rebar --force - mix deps.get && mix tz_world.update - mix phx.digest - mix release --path release/mobilizon - - cd release/mobilizon && ln -s lib/mobilizon-*/priv priv + - cd release/mobilizon && ln -s lib/mobilizon-*/priv priv && cd ../../ - du -sh release/ + - 'echo "Artifact: ${APP_ASSET}"' + - tar czf ${APP_ASSET} -C release mobilizon + - du -sh ${APP_ASSET} only: - tags@framasoft/mobilizon artifacts: @@ -240,14 +245,10 @@ release-upload: stage: upload image: framasoft/yakforms-assets-deploy:latest rules: *tag-rules + variables: + APP_VERSION: "${CI_COMMIT_TAG}" + APP_ASSET: "${CI_PROJECT_NAME}_${APP_VERSION}_${ARCH}.tar.gz" script: - - APP_VERSION="${CI_COMMIT_TAG}" - - APP_ASSET="${CI_PROJECT_NAME}_${APP_VERSION}_${ARCH}.tar.gz" - - - 'echo "Artifact: ${APP_ASSET}"' - - tar czf ${APP_ASSET} -C release mobilizon - - ls -al ${APP_ASSET} - - eval `ssh-agent -s` - ssh-add <(echo "${DEPLOYEMENT_KEY}" | base64 --decode -i) - echo "put -r ${APP_ASSET}" | sftp -o "VerifyHostKeyDNS yes" ${DEPLOYEMENT_USER}@${DEPLOYEMENT_HOST}:public/