Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
euanmillar committed Dec 14, 2023
2 parents b530937 + 1b563dc commit 7cead57
Show file tree
Hide file tree
Showing 28 changed files with 765 additions and 212 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,19 @@ jobs:
cd opencrvs-core
git checkout ${{ github.event.inputs.core-image-tag }}
- name: Read known hosts
run: |
cd ${{ github.event.repository.name }}
echo "KNOWN_HOSTS<<EOF" >> $GITHUB_ENV
sed -i -e '$a\' ./infrastructure/.known-hosts
cat ./infrastructure/.known-hosts >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: ${{ env.KNOWN_HOSTS }}

- name: Login to DockerHub
uses: docker/login-action@v1
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy(development)
name: Deploy (development)
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_dispatch:
Expand All @@ -11,6 +11,7 @@ on:
options:
- staging
- qa
- development
core-image-tag:
description: Core DockerHub image tag
required: true
Expand Down Expand Up @@ -60,11 +61,19 @@ jobs:
cd opencrvs-core
git checkout ${{ github.event.inputs.core-image-tag }}
- name: Read known hosts
run: |
cd ${{ github.event.repository.name }}
echo "KNOWN_HOSTS<<EOF" >> $GITHUB_ENV
sed -i -e '$a\' ./infrastructure/.known-hosts
cat ./infrastructure/.known-hosts >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: ${{ env.KNOWN_HOSTS }}

- name: Login to DockerHub
uses: docker/login-action@v1
Expand Down
41 changes: 3 additions & 38 deletions .github/workflows/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
default: qa
required: true
options:
- development
- staging
- qa
- production
Expand Down Expand Up @@ -51,26 +52,8 @@ jobs:
fetch-depth: 0
path: './${{ github.event.repository.name }}'

- name: Set environment type ENV_TYPE
run: |
if [ "${{ github.event.inputs.environment }}" == "production" ]; then
echo "ENV_TYPE=production" >> "$GITHUB_ENV"
else
echo "ENV_TYPE=qa" >> "$GITHUB_ENV"
fi
- name: Setup PEM file
# Secret didn't work directly in the if condition
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
if: ${{ env.SSH_KEY }}
run: |
echo "${{ secrets.SSH_KEY }}" > /tmp/server.pem
chmod 600 /tmp/server.pem
- name: Set variables for ansible in production environments
id: ansible-production-variables
if: env.ENV_TYPE == 'production'
id: ansible-variables
run: |
JSON_WITH_NEWLINES=$(cat<<EOF
${{ toJSON(env) }}
Expand All @@ -93,24 +76,6 @@ jobs:
manager_production_server_ip: ${{ secrets.SSH_HOST }}
ansible_user: ${{ secrets.SSH_USER }}

- name: Set variables for ansible in qa environments
id: ansible-variables
if: env.ENV_TYPE == 'qa'
run: |
JSON_WITH_NEWLINES=$(cat<<EOF
${{ toJSON(env) }}
EOF)
JSON_WITHOUT_NEWLINES=$(echo $JSON_WITH_NEWLINES | jq -R -c .)
echo "EXTRA_VARS=$JSON_WITHOUT_NEWLINES" >> $GITHUB_OUTPUT
env:
encrypted_disk_size: ${{ vars.DISK_SPACE }}
disk_encryption_key: ${{ secrets.ENCRYPTION_KEY }}
dockerhub_username: ${{ secrets.DOCKER_USERNAME }}
dockerhub_password: ${{ secrets.DOCKER_TOKEN }}
mongodb_admin_username: ${{ secrets.MONGODB_ADMIN_USER }}
mongodb_admin_password: ${{ secrets.MONGODB_ADMIN_PASSWORD }}
elasticsearch_superuser_password: ${{ secrets.ELASTICSEARCH_SUPERUSER_PASSWORD }}

- name: Read known hosts
run: |
cd ${{ github.event.repository.name }}
Expand All @@ -136,6 +101,6 @@ jobs:
directory: ${{ github.event.repository.name }}/infrastructure/server-setup
options: |
--verbose
--inventory ${{ github.event.inputs.environment }}.ini
--inventory ${{ github.event.inputs.environment }}.yml
${{ inputs.tag != 'all' && format('--tags={0}', inputs.tag) || ''}}
--extra-vars ""${{ steps.ansible-variables.outputs.EXTRA_VARS }}""
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ graphql.schema.json
*.tar.gz
9. config: Translations
*.xlsx
.secrets
7 changes: 7 additions & 0 deletions infrastructure/.known-hosts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@
|1|mmWxyVhdNt+9vCZY8YSu/b5T6mI=|oWUySmyU/yK3gMAgrMpcfutjats= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEp49NpGjmoCmYAHnNbZF6dpo0G3L3Z3m++B4Pq3sVUTLwMuNv4WfoebiSJH20tcTq92XbFV5NfCmdnfoksr/1Y=
|1|EWKHZMaMYdiCWDSqV8DsOmqFJ3c=|GQ0ApYEAoubxL2n9VFMY5cnN8Yc= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDJkWafUYUyF1eOzj1WqhjwJc+TvMjKmz0bCqtci5BMNUsn+R+Z+CIOPvI8eqYEzXiJ7VGAZq1twRYGSnRTJyCja3eJfvQfxb8hGVz2fkf9rthgYABdoHSJoGMTt4EP2LtTduzvLPCBctiID6bXUFMkM6j2pmLQK/gZGEKNaJb86D7xt1HXQsqV5bAAKCaehgn6LAQ8zee9YZtoP8fwhoorTJEJ3kpsvsneEpV3kiuAPdyfB8zI7E3HHqXgD+ij0eFogK+NSUIMUexFyRZgAtKDBjnNRQLGMEzY1UzM7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E2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBC6FQAe/NJr47AbOwedQoK9+pIgaiBte1c66fLTSsNnWiBEvte4JL4ar+DHtbjhE8Huzui+Bn9U/JFo/VzgTWzQ=
Loading

0 comments on commit 7cead57

Please sign in to comment.