Skip to content

Commit

Permalink
avniproject/avni-product#1445 | Use master circleci config
Browse files Browse the repository at this point in the history
  • Loading branch information
himeshr committed Feb 5, 2024
1 parent 6291c9b commit 770499b
Showing 1 changed file with 30 additions and 23 deletions.
53 changes: 30 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
version: 2.1
orbs:
aws-cli: circleci/[email protected]

commands:
deploy:
description: "Deployment of rules server"
Expand Down Expand Up @@ -62,6 +65,24 @@ commands:
VAULT_PASSWORD_FILE=~/.vault-pass.txt app_zip_path=~/artifacts/ make rules-server-<< parameters.env >>
- run: rm ~/.vault-pass.txt
setup_server_access:
description: Generate and copy temporary keys to server
parameters:
instance-id:
type: string
os-user:
type: string
default: ubuntu
availability-zone:
type: string
default: ap-south-1a
steps:
- run: rm -rf /tmp/temp_rsa_key*
- run: ssh-keygen -b 2048 -t rsa -f /tmp/temp_rsa_key -q -N ""
- run: eval `ssh-agent -s`
- run: ssh-add /tmp/temp_rsa_key
- run: |
aws ec2-instance-connect send-ssh-public-key --instance-id << parameters.instance-id >> --availability-zone << parameters.availability-zone >> --instance-os-user << parameters.os-user >> --no-paginate --ssh-public-key file:///tmp/temp_rsa_key.pub --output text | head -1
jobs:
app_test:
Expand Down Expand Up @@ -110,7 +131,7 @@ jobs:
paths:
- ./node_modules

# https://serverfault.com/questions/265675/how-can-i-zip-compress-a-symlink
# https://serverfault.com/questions/265675/how-can-i-zip-compress-a-symlink
- run: zip --symlinks -r ~/rules-server.zip ../rules-server

- run: tar -czvf ~/rules-server.tgz -C ../rules-server .
Expand All @@ -132,7 +153,7 @@ jobs:

- store_artifacts:
path: ~/artifacts

build_docker_image:
docker:
- image: docker:git
Expand Down Expand Up @@ -198,20 +219,13 @@ jobs:
steps:
- deploy:
hostname: "ssh.perf.openchs.org"
NEW_PRODUCTION_deploy:
PRODUCTION_deploy:
docker:
- image: cimg/deploy:2023.09-node
working_directory: ~/
steps:
- deploy_ansible:
env: "prod"
PRODUCTION_deploy:
docker:
- image: cimg/node:10.24.1
working_directory: ~/
steps:
- deploy:
hostname: "ssh.server.openchs.org"
RWB_STAGING_deploy:
docker:
- image: cimg/deploy:2023.09-node
Expand All @@ -226,7 +240,7 @@ jobs:
- deploy_ansible:
env: "rwb-staging"

RWB_PROD_deploy:
RWB_PRODUCTION_deploy:
docker:
- image: cimg/deploy:2023.09-node
working_directory: ~/
Expand All @@ -239,7 +253,7 @@ jobs:
availability-zone: "ap-south-1a"
- deploy_ansible:
env: "rwb-prod"

tags_filter: &tags_filter
filters:
tags:
Expand Down Expand Up @@ -285,14 +299,6 @@ workflows:
context: prod-deploy
requires:
- PRODUCTION_approve
- NEW_PRODUCTION_approve:
type: approval
requires:
- app_build
- NEW_PRODUCTION_deploy:
context: prod-deploy
requires:
- NEW_PRODUCTION_approve
- PRERELEASE_approve:
type: approval
requires:
Expand All @@ -319,16 +325,17 @@ workflows:
- non-prod-deploy
requires:
- RWB_STAGING_approve
- RWB_PROD_approve:
- RWB_PRODUCTION_approve:
type: approval
requires:
- app_build
- RWB_PROD_deploy:
- RWB_PRODUCTION_deploy:
context:
- RWB_AWS_OIDC
- prod-deploy
requires:
- RWB_PROD_approve
- RWB_PRODUCTION_approve

notify:
webhooks:
- url: https://webhooks.gitter.im/e/0fdffde721194986f2a0

0 comments on commit 770499b

Please sign in to comment.