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

Commit 6107f4df authored by Ronak Patel's avatar Ronak Patel
Browse files

reverted gitlab

parent bcf0188d
Loading
Loading
Loading
Loading
Loading
+0 −48
Original line number Original line Diff line number Diff line
variables:
variables:
    TO_PACKAGE: 'appinfo css l10n lib templates js img'
    TO_PACKAGE: 'appinfo css l10n lib templates js img'
    CONTAINER_IMAGE: ubuntu
    CONTAINER_TAG: focal
    CONTAINER_NAME: nextcloud
    APP_NAME: $CI_PROJECT_NAME
    APP_ENABLE_ARGS: ''

  
include:
include:
  - project: "e/infra/ecloud/nextcloud-apps/ci-templates"
  - project: "e/infra/ecloud/nextcloud-apps/ci-templates"
    ref: main
    ref: main
@@ -14,44 +7,3 @@ include:
  - project: "e/infra/ecloud/nextcloud-apps/ci-templates"
  - project: "e/infra/ecloud/nextcloud-apps/ci-templates"
    ref: main
    ref: main
    file: "nc-apps-deploy.yml"
    file: "nc-apps-deploy.yml"

.deploy:nextcloud-app:
  stage: deploy
  # assuming all deployment will happen with sames image
  image: $CONTAINER_IMAGE:$CONTAINER_TAG
  # assuming we will need to add SSH for all deployment
  before_script:
    - echo "FAIL" > .job_status
    - 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 ${APP_NAME} to $CI_ENVIRONMENT_NAME ($DEPLOYMENT_HOST)"
    - rsync -avzh dist/ $SSH_USER@$DEPLOYMENT_HOST:/tmp/${CI_JOB_ID}
    - ssh $SSH_USER@$DEPLOYMENT_HOST "sudo docker exec -u www-data $CONTAINER_NAME /usr/local/bin/php /var/www/html/occ app:disable ${APP_NAME} && 
      sudo rsync -avzh --chown www-data:www-data --delete /tmp/${CI_JOB_ID}/${APP_NAME} ${DEPLOYMENT_PATH}/html/custom_apps/ && 
      sudo docker exec -u www-data $CONTAINER_NAME /usr/local/bin/php /var/www/html/occ app:enable ${APP_ENABLE_ARGS} ${APP_NAME}"
    - echo "SUCCESS" > .job_status
  after_script:
    # reading job status, checking it and implementing additional steps
    # are not handled here as rm -rf /tmp/${CI_JOB_ID} will always execute
    - ssh $SSH_USER@$DEPLOYMENT_HOST "rm -rf /tmp/${CI_JOB_ID}"

deploy:staging:
  extends: .deploy:nextcloud-app
  when: manual
  only:
    - main
    - murena-main
    - production
    - tags
    - dev/delete-murena-account-changes
  environment:
    name: staging/01
    url: https://eeo.one