From cfb53ade465fdc2958668c203dfa94cbfb10d562 Mon Sep 17 00:00:00 2001 From: Fazle Rabbi Date: Tue, 14 Mar 2023 15:09:59 +0600 Subject: [PATCH 1/3] fix rsync path --- .gitlab-ci.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5bdf18f4..e2232c90 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,14 @@ include: .deploy:nextcloud-app-by-checkout: script: - - ssh $SSH_USER@$DEPLOYMENT_HOST "git clone --depth 1 $CI_REPOSITORY_URL --branch $CI_COMMIT_REF_NAME --single-branch /tmp/${CI_JOB_ID}/${APP_NAME} && sudo rsync -avzh --chown www-data:www-data --delete --exclude '.git*' /tmp/${CI_JOB_ID}/${eCloud} ${DEPLOYMENT_PATH}/html/themes/ && rm -rf /tmp/${CI_JOB_ID} && docker exec -u www-data $CONTAINER_NAME /usr/local/bin/php /var/www/html/occ maintenance:theme:update" - - - + # print var to confirm + - echo "Deploying $APP_NAME to $CI_ENVIRONMENT_NAME ($DEPLOYMENT_HOST)" + # clone repo to /tmp + - | + ssh $SSH_USER@$DEPLOYMENT_HOST /bin/bash -s << EOT + git clone --depth 1 $CI_REPOSITORY_URL --branch $CI_COMMIT_REF_NAME --single-branch /tmp/${CI_JOB_ID}/${APP_NAME} + sudo rsync -avzh --chown www-data:www-data --delete --exclude '.git*' /tmp/${CI_JOB_ID}/${APP_NAME} ${DEPLOYMENT_PATH}/html/themes/${APP_PATH} + docker exec -u www-data $CONTAINER_NAME /usr/local/bin/php /var/www/html/occ maintenance:theme:update + fi + EOT + - echo "SUCCESS" > .job_status -- GitLab From 25c417fabee4bcc0548010f66317d1166a713814 Mon Sep 17 00:00:00 2001 From: Fazle Rabbi Date: Tue, 14 Mar 2023 16:35:00 +0600 Subject: [PATCH 2/3] use APP_NAME --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e2232c90..e1a96d1e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ include: - | ssh $SSH_USER@$DEPLOYMENT_HOST /bin/bash -s << EOT git clone --depth 1 $CI_REPOSITORY_URL --branch $CI_COMMIT_REF_NAME --single-branch /tmp/${CI_JOB_ID}/${APP_NAME} - sudo rsync -avzh --chown www-data:www-data --delete --exclude '.git*' /tmp/${CI_JOB_ID}/${APP_NAME} ${DEPLOYMENT_PATH}/html/themes/${APP_PATH} + sudo rsync -avzh --chown www-data:www-data --delete --exclude '.git*' /tmp/${CI_JOB_ID}/${APP_NAME} ${DEPLOYMENT_PATH}/html/themes/${APP_NAME} docker exec -u www-data $CONTAINER_NAME /usr/local/bin/php /var/www/html/occ maintenance:theme:update fi EOT -- GitLab From ab3e28083b8ac7b01388267202d5df572dbbc411 Mon Sep 17 00:00:00 2001 From: Fazle Rabbi Date: Tue, 14 Mar 2023 17:04:56 +0600 Subject: [PATCH 3/3] remove fi from unused if condition --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e1a96d1e..a48db098 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,6 +17,5 @@ include: git clone --depth 1 $CI_REPOSITORY_URL --branch $CI_COMMIT_REF_NAME --single-branch /tmp/${CI_JOB_ID}/${APP_NAME} sudo rsync -avzh --chown www-data:www-data --delete --exclude '.git*' /tmp/${CI_JOB_ID}/${APP_NAME} ${DEPLOYMENT_PATH}/html/themes/${APP_NAME} docker exec -u www-data $CONTAINER_NAME /usr/local/bin/php /var/www/html/occ maintenance:theme:update - fi EOT - echo "SUCCESS" > .job_status -- GitLab