From a503ef06ee43abba42b8a64c42e8b8f8da75e1f5 Mon Sep 17 00:00:00 2001 From: Peio Rigaux Date: Fri, 21 Mar 2025 17:43:04 +0100 Subject: [PATCH] Now use docker to deploy. Allows multiple deploy at the same time --- .gitlab-ci-files/job-upload.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci-files/job-upload.yml b/.gitlab-ci-files/job-upload.yml index 7ba81e8b4..ddb1be140 100644 --- a/.gitlab-ci-files/job-upload.yml +++ b/.gitlab-ci-files/job-upload.yml @@ -1,12 +1,20 @@ job-android-upload: stage: deploy - tags: [ "deploy" ] + tags: [ "docker-deploy" ] only: - schedules dependencies: - job-android + before_script: + - if ! [ -z ${SCP_PRIVATE_KEY+x} ] && ! [ -z ${DEPLOY_SERVER_HOST_KEYS+x} ]; then eval $(ssh-agent -s); fi + - if ! [ -z ${SCP_PRIVATE_KEY+x} ]; then echo "$SCP_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null; fi + - if ! [ -z ${DEPLOY_SERVER_HOST_KEYS+x} ]; then mkdir -p ~/.ssh && chmod 700 ~/.ssh; fi + - if ! [ -z ${DEPLOY_SERVER_HOST_KEYS+x} ]; then echo "$DEPLOY_SERVER_HOST_KEYS" >> ~/.ssh/known_hosts; fi + script: - - cd app/build/outputs/apk/ && rsync ./release/*.apk $DEPLOY_SERVER:$ANDROID_DEPLOY_DIRECTORY \ No newline at end of file + # Launches rsync in partial mode, which means that we are using a temp_dir in case of a transfer issue + # Upon a job relaunch, the files in temp_dir would then be re-used, and deleted if the transfer succeeds + - cd app/build/outputs/apk/ && rsync --partial --partial-dir=$CI_PIPELINE_ID_$CI_JOB_NAME ./release/*.apk $DEPLOY_SERVER:$ANDROID_DEPLOY_DIRECTORY \ No newline at end of file