Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0cfe5c7 authored by Nicolas Gelot's avatar Nicolas Gelot
Browse files

Merge branch 'dev/001-publish-theme' into 'main'

add publish job

See merge request !61
parents 3f0e2899 32558de5
Loading
Loading
Loading
Loading
Loading
+23 −2
Original line number Diff line number Diff line
stages:
  - test
  - build
  - performance
  - dast
  - publish
  - deploy

variables:
  APP_NAME: "snappymail"
  APP_PATH: "html/themes/"

include:
  - project: "e/infra/ecloud/nextcloud-apps/ci-templates"
    ref: main
@@ -17,6 +23,21 @@ include:
  - project: "e/infra/ecloud/nextcloud-apps/ci-templates"
    ref: main
    file: "populate-code-climate-default-config.yml"
  - project: "e/infra/ecloud/nextcloud-apps/ci-templates"
    ref: main
    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:
@@ -28,8 +49,8 @@ include:
    - |
      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}/snappymail
      sudo rsync -avzh --chown www-data:www-data --delete --exclude '.git*' /tmp/${CI_JOB_ID}/${APP_NAME} ${DEPLOYMENT_PATH}${APP_PATH}
      git clone --depth 1 $CI_REPOSITORY_URL --branch $CI_COMMIT_REF_NAME --single-branch /tmp/${CI_JOB_ID}/Murena/${APP_NAME}
      sudo rsync -avzh --chown www-data:www-data --delete --exclude '.git*' /tmp/${CI_JOB_ID}/Murena ${DEPLOYMENT_PATH}${APP_PATH}
      EOT
    - echo "SUCCESS" > .job_status
  after_script: