Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Merge branch 'develop' into develop" #445

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module.exports = {
fhir: true
},
env: {
node: true,
jest: true
node: true
}
}
7 changes: 2 additions & 5 deletions .github/workflows/clear-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
environment:
required: true
type: string
outputs:
outcome:
value: ${{ jobs.reset-data.outputs.outcome }}
workflow_dispatch:
inputs:
environment:
Expand All @@ -23,7 +20,7 @@ on:
jobs:
reset-data:
name: 'Reset data'
environment: ${{ inputs.environment }}
environment: ${{ github.event.inputs.environment }}
runs-on: ubuntu-24.04
outputs:
outcome: ${{ steps.reset-data.outcome }}
Expand All @@ -32,7 +29,7 @@ jobs:
- name: Clone country config resource package
uses: actions/checkout@v3
with:
fetch-depth: 1
fetch-depth: 0
path: './${{ github.event.repository.name }}'

- name: Read known hosts
Expand Down
196 changes: 0 additions & 196 deletions .github/workflows/deploy-and-e2e.yml

This file was deleted.

10 changes: 1 addition & 9 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
core-image-tag:
description: Core DockerHub image tag
required: true
default: 'v1.7.0'
default: 'v1.5.0'
countryconfig-image-tag:
description: Your Country Config DockerHub image tag
required: true
Expand All @@ -25,14 +25,6 @@ jobs:
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: trstringer/manual-approval@v1
with:
secret: ${{ github.TOKEN }}
approvers: euanmillar,rikukissa,alsmk
minimum-approvals: 1
issue-title: 'Deploy (${{ github.event.inputs.environment }}): core: ${{ github.event.inputs.core-image-tag }} country config: ${{ github.event.inputs.countryconfig-image-tag }}'
issue-body: 'Please approve or deny the deployment of core: ${{ github.event.inputs.core-image-tag }} country config: ${{ github.event.inputs.countryconfig-image-tag }} to ${{ github.event.inputs.environment }}'
exclude-workflow-initiator-as-approver: false
- name: Clone core
uses: actions/checkout@v3
with:
Expand Down
60 changes: 17 additions & 43 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,6 @@
name: Deploy (development)
run-name: Deploy to ${{ inputs.environment }} with reset=${{ inputs.reset }} core=${{ inputs.core-image-tag }} country config=${{ inputs.countryconfig-image-tag }}
run-name: Deploy to ${{ github.event.inputs.environment }} with reset=${{ github.event.inputs.reset }} core=${{ github.event.inputs.core-image-tag }} country config=${{ github.event.inputs.countryconfig-image-tag }}
on:
workflow_call:
inputs:
environment:
type: string
description: Environment to deploy to
required: true
core-image-tag:
type: string
description: Core DockerHub image tag
required: true
default: 'v1.4.1'
countryconfig-image-tag:
type: string
description: Your Country Config DockerHub image tag
required: true
reset:
type: string
description: Reset the environment
default: 'false'
required: false
debug:
type: boolean
description: Open SSH session to the runner after deployment
default: false
required: false
workflow_dispatch:
inputs:
environment:
Expand All @@ -37,11 +12,10 @@ on:
- staging
- qa
- development
- e2e
core-image-tag:
description: Core DockerHub image tag
required: true
default: 'v1.7.0'
default: 'v1.5.0'
countryconfig-image-tag:
description: Your Country Config DockerHub image tag
required: true
Expand All @@ -51,7 +25,7 @@ on:
default: false
jobs:
deploy:
environment: ${{ inputs.environment }}
environment: ${{ github.event.inputs.environment }}
runs-on: ubuntu-24.04
outputs:
outcome: ${{ steps.deploy.outcome }}
Expand All @@ -72,13 +46,13 @@ jobs:
- name: Checkout country branch
run: |
cd ${{ github.event.repository.name }}
git checkout ${{ inputs.countryconfig-image-tag }}
git checkout ${{ github.event.inputs.countryconfig-image-tag }}
cd ../

- name: Checkout core branch
run: |
cd opencrvs-core
git checkout ${{ inputs.core-image-tag }}
git checkout ${{ github.event.inputs.core-image-tag }}

- name: Read known hosts
run: |
Expand Down Expand Up @@ -113,7 +87,7 @@ jobs:
sleep 10
done
while true; do
if docker manifest inspect ${{ secrets.DOCKERHUB_ACCOUNT }}/${{ secrets.DOCKERHUB_REPO }}:${{ inputs.countryconfig-image-tag }}; then
if docker manifest inspect ${{ secrets.DOCKERHUB_ACCOUNT }}/${{ secrets.DOCKERHUB_REPO }}:${{ github.event.inputs.countryconfig-image-tag }}; then
break
fi
sleep 10
Expand All @@ -132,7 +106,7 @@ jobs:
# This includes SSH_KEY and KNOWN_HOSTS
#
while IFS= read -r secret; do
echo "$secret" >> .env.${{ inputs.environment }}
echo "$secret" >> .env.${{ github.event.inputs.environment }}
done < <(
jq -r '
to_entries |
Expand All @@ -148,7 +122,7 @@ jobs:
EOF)

while IFS= read -r var; do
echo "$var" >> .env.${{ inputs.environment }}
echo "$var" >> .env.${{ github.event.inputs.environment }}
done < <(
jq -r '
to_entries |
Expand All @@ -165,34 +139,34 @@ jobs:
node-version: 18
node-version-file: .nvmrc

- name: Deploy to ${{ inputs.environment }}
- name: Deploy to ${{ github.event.inputs.environment }}
id: deploy
run: |
cd ./${{ github.event.repository.name }}
yarn deploy \
--clear_data=no \
--environment=${{ inputs.environment }} \
--environment=${{ github.event.inputs.environment }} \
--host=${{ vars.DOMAIN }} \
--ssh_host=${{ vars.SSH_HOST || secrets.SSH_HOST }} \
--ssh_port=${{ vars.SSH_PORT || secrets.SSH_PORT }} \
--ssh_user=${{ secrets.SSH_USER }} \
--version=${{ inputs.core-image-tag }} \
--country_config_version=${{ inputs.countryconfig-image-tag }} \
--version=${{ github.event.inputs.core-image-tag }} \
--country_config_version=${{ github.event.inputs.countryconfig-image-tag }} \
--replicas=${{ vars.REPLICAS }}

reset:
needs: deploy
if: ${{ inputs.reset == 'true' && needs.deploy.outputs.outcome == 'success' }}
if: ${{ github.event.inputs.reset == 'true' && needs.deploy.outputs.outcome == 'success' }}
uses: ./.github/workflows/clear-environment.yml
with:
environment: ${{ inputs.environment }}
environment: ${{ github.event.inputs.environment }}
secrets: inherit

seed-data:
needs: reset
if: ${{ inputs.reset == 'true' && needs.reset.outputs.outcome == 'success' }}
if: ${{ github.event.inputs.reset == 'true' && needs.reset.outputs.outcome == 'success' }}
uses: ./.github/workflows/seed-data.yml
with:
environment: ${{ inputs.environment }}
core-image-tag: ${{ inputs.core-image-tag }}
environment: ${{ github.event.inputs.environment }}
core-image-tag: ${{ github.event.inputs.core-image-tag }}
secrets: inherit
Loading
Loading