Commit c74c5a16 authored by Akhil's avatar Akhil 😶
Browse files

Added gitlab ci

parent 59a95eab
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}/ecloud-accounts && sudo rsync -avzh --chown www-data:www-data --delete --exclude '.git*' /tmp/${CI_JOB_ID}/ecloud-accounts ${DEPLOYMENT_PATH}/html/custom_apps/ && rm -rf /tmp/${CI_JOB_ID}"
deploy:dev01:
extends: .deploy:nextcloud-app
only:
- master
- main
- production
- nc21
environment:
name: dev/01
url: https://dev.eeo.one/
variables:
DEPLOYMENT_BRANCH: $CI_COMMIT_BRANCH
CONTAINER_NAME: dev01_nextcloud
deploy:dev02:
extends: .deploy:nextcloud-app
when: manual
only:
- master
- main
- production
- nc21
environment:
name: dev/02
url: https://ecloud02.dev.eeo.one
variables:
DEPLOYMENT_BRANCH: $CI_COMMIT_BRANCH
CONTAINER_NAME: dev02_nextcloud
deploy:dev03:
extends: .deploy:nextcloud-app
when: manual
only:
- master
- main
- production
- nc21
environment:
name: dev/03
url: https://ecloud03.dev.eeo.one
variables:
DEPLOYMENT_BRANCH: $CI_COMMIT_BRANCH
CONTAINER_NAME: dev03_nextcloud
deploy:staging:
extends: .deploy:nextcloud-app
when: manual
only:
- master
- main
- production
- nc21
environment:
name: staging/01
url: https://eeo.one
variables:
DEPLOYMENT_BRANCH: $CI_COMMIT_BRANCH
CONTAINER_NAME: nextcloud
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment