Skip to content

Commit

Permalink
avniproject/avni-product#1433 | Deploy to new staging
Browse files Browse the repository at this point in the history
(cherry picked from commit 3b678f0)
  • Loading branch information
1t5j0y authored and himeshr committed Nov 27, 2023
1 parent 95439c6 commit 2e2f1ab
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,43 @@ commands:
sudo rm -rf /tmp/avni-server.rpm
EOF
deploy_as_service:
description: Deployment of avni-server as a systemd service
parameters:
env:
type: string
default: "staging"
steps:
- attach_workspace:
at: ~/artifacts

- run: sudo apt-get install make openssl

- run:
name: Install dependencies
command: |
sudo apt-get -y -qq update
sudo apt-get -y -qq install python3-pip
sudo pip3 install awscli --upgrade
# sudo pip3 install ansible

- run: curl -L https://github.com/avniproject/avni-infra/archive/master.zip >> ~/infra.zip

- run: |
cd ~/
unzip infra.zip
mv avni-infra-master avni-infra
rm -rf infra.zip
- run: echo $ANSIBLE_VAULT_PASS > ~/.vault-pass.txt

- run: |
pwd
cd ~/avni-infra/configure
VAULT_PASSWORD_FILE=~/.vault-pass.txt app_zip_path=~/artifacts/ make deploy-avni-server-<< parameters.env >>
- run: rm ~/.vault-pass.txt

jobs:
test:
docker:
Expand Down Expand Up @@ -185,6 +222,14 @@ jobs:
- deploy:
hostname: "ssh.staging.openchs.org"

NEW_STAGING_deploy:
docker:
- image: cimg/deploy
working_directory: ~/
steps:
- deploy_as_service:
env: "staging"

UAT_deploy:
docker:
- image: circleci/openjdk:8-jdk
Expand Down Expand Up @@ -250,6 +295,14 @@ workflows:
context: non-prod-deploy
requires:
- STAGING_approve
- NEW_STAGING_approve:
type: approval
requires:
- build
- NEW_STAGING_deploy:
context: non-prod-deploy
requires:
- NEW_STAGING_approve
- UAT_approve:
type: approval
requires:
Expand Down

0 comments on commit 2e2f1ab

Please sign in to comment.