From 7295685114ae0445309c9affd742c6c240824aec Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Tue, 14 Oct 2025 15:15:10 +0530 Subject: [PATCH] used 26.0.2 --- .gitlab-ci.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7f6762a1..b2f0604d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,19 +1,44 @@ +stages: + - test + - build + - performance + - dast + - publish + - deploy + variables: APP_NAME: eCloud # Deploy stage include: - - project: 'e/infra/ecloud/nextcloud-apps/ci-templates' + - project: "e/infra/ecloud/nextcloud-apps/ci-templates" + ref: main + file: "nc-apps-checkout-deploy.yml" + - project: "e/infra/ecloud/nextcloud-apps/ci-templates" ref: main - file: 'nc-apps-checkout-deploy.yml' + file: "nc-publish-app.yml" + +copy-theme-files: + stage: build + image: + name: alpine/git:v2.49.0 + entrypoint: [""] + script: + - mkdir -p dist/${APP_NAME} + - git archive ${CI_COMMIT_SHA} | tar -x -C dist/${APP_NAME} + artifacts: + paths: + - dist/ .deploy:nextcloud-app-by-checkout: script: + - set -e # 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 + set -e 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 -- GitLab