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

Commit 622b92bc authored by Fazle Rabbi's avatar Fazle Rabbi 💬 Committed by Arnau Vàzquez
Browse files

Add deploy CI template to rainloop-nexcloud

parent 523518ba
Loading
Loading
Loading
Loading
+10 −44
Original line number Diff line number Diff line
stages:
    - deploy

.deploy:nextcloud-app:
    image: ubuntu:focal
    stage: deploy
    before_script: 
      - mkdir $HOME/.ssh
      - chmod 700 ~/.ssh
      - echo "$SSH_PRIVATE_KEY_ED" > $HOME/.ssh/id_ed25519
      - echo "$SSH_PUBKEY_ED" > $HOME/.ssh/id_ed25519.pub
      - echo "$SSH_KNOWN_HOSTS" > $HOME/.ssh/known_hosts
      - chmod 600 ~/.ssh/id_ed25519
      - chmod 644 ~/.ssh/known_hosts ~/.ssh/id_ed25519.pub
      - apt-get update && apt-get install -y openssh-client rsync
    script:
    - echo "Deploying to $CI_ENVIRONMENT_NAME ($DEPLOYMENT_HOST)"
    - ssh $SSH_USER@$DEPLOYMENT_HOST "git clone --depth 1 $CI_REPOSITORY_URL --branch $DEPLOYMENT_BRANCH --single-branch /tmp/${CI_JOB_ID}/rainloop && sudo rsync -avzh --chown www-data:www-data --delete --exclude '.git*' /tmp/${CI_JOB_ID}/rainloop ${DEPLOYMENT_PATH}/html/custom_apps/ && rm -rf /tmp/${CI_JOB_ID} && rm -rf ${DEPLOYMENT_PATH}/data/rainloop-storage/_data_/_default_/cache/*"

deploy:dev01:
    extends: .deploy:nextcloud-app
    when: manual
    only:
      - /^dev\/.*$/
    environment:
      name: dev/01
      url: https://dev.eeo.one/
variables:
      DEPLOYMENT_BRANCH: $CI_COMMIT_BRANCH
      CONTAINER_NAME: dev01_nextcloud

deploy:staging:
  extends: .deploy:nextcloud-app
  when: manual
  only:
    - production
    - ecloud-main
  environment:
    name: staging/01
    url: https://eeo.one
  variables:
    DEPLOYMENT_BRANCH: $CI_COMMIT_BRANCH
    CONTAINER_NAME: nextcloud
    APP_NAME: rainloop
include:
  - project: "e/infra/ecloud/nextcloud-apps/ci-templates"
    ref: main
    file: "nc-apps-checkout-deploy.yml"

.deploy:nextcloud-app-by-checkout:
  after_script:
    - rm -rf ${DEPLOYMENT_PATH}/data/rainloop-storage/_data_/_default_/cache/*