Skip to content

Commit

Permalink
Merge pull request #629 from IntersectMBO/test
Browse files Browse the repository at this point in the history
Update All cards with GA details, extensive refactor UI and Fixes
  • Loading branch information
pmbinapps authored Apr 5, 2024
2 parents 5ece031 + 987aa1e commit 4e0ebe1
Show file tree
Hide file tree
Showing 449 changed files with 20,643 additions and 7,185 deletions.
22 changes: 5 additions & 17 deletions scripts/govtool/.env.example → .envrc.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# vim: set ft=bash
# This file is a template for the environment variables that need to be set and
# should be copied to `.env` or `.envrc` and filled in with the correct values.

# Tell direnv to use Nix configuration.
# See https://direnv.net/docs/hook.html#nix.
use nix shell.nix
# should be copied to `.envrc` and filled in with the correct values.

# target environment: dev, test, staging or beta
export ENVIRONMENT=<ENVIRONMENT>
Expand Down Expand Up @@ -34,33 +30,25 @@ export GRAFANA_SLACK_RECIPIENT=<GRAFANA_SLACK_RECIPIENT>
export GRAFANA_SLACK_OAUTH_TOKEN=<GRAFANA_SLACK_OAUTH_TOKEN>
# the basic auth credentials for the Nginx proxy
export NGINX_BASIC_AUTH=<NGINX_BASIC_AUTH>
# the IP addresses that bypass the basic auth
export IP_ADDRESS_BYPASSING_BASIC_AUTH1=<IP_ADDRESS_BYPASSING_BASIC_AUTH1>
export IP_ADDRESS_BYPASSING_BASIC_AUTH2=<IP_ADDRESS_BYPASSING_BASIC_AUTH2>


# The following code is a nice way to display what environment we are in.
function warn() {
tput bold; tput setaf $2; echo "GovTool: $1"; tput sgr0
}

tput bold
# the domain name for the target environment
case "$ENVIRONMENT" in
"dev")
export DOMAIN="dev-${CARDANO_NETWORK}.govtool.byron.network"
warn "This is a DEV environment, all good!" 2
;;
"test")
export DOMAIN="test-${CARDANO_NETWORK}.govtool.byron.network"
warn "This is TEST environment, be careful…" 4
;;
"staging")
export DOMAIN="staging.govtool.byron.network"
warn "This is STAGING environment, be careful…" 5
;;
"beta")
export DOMAIN="sanchogov.tools"
warn "This is BETA environment, BE CAREFUL!" 1
;;
*)
warn "Unknown environment, exiting…" 1
exit 1
;;
esac
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ assignees: ''
<!-- A description of the (reproducible) outcome. -->

## Expected behavior
<!-- A description of what you expect to happen instead. -->
<!-- A description of what you expect to happen instead. -->
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ contact_links:

- name: All issues
url: https://github.com/IntersectMBO/govtool/issues
about: Check whether your issue is not already covered here.
about: Check whether your issue is not already covered here.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_idea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ body:
Which technical solutions, libraries or systems should be used, which
components need to change, steps how to implement this, ...
validations:
required: true
required: true
1 change: 0 additions & 1 deletion .github/dbsync-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -987,4 +987,3 @@ FROM tx_out
LEFT JOIN block ON tx.block_id = block.id
WHERE tx_in.tx_in_id IS NULL
AND block.epoch_no IS NOT NULL;

65 changes: 65 additions & 0 deletions .github/workflows/build-and-deploy-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build and deploy GovTool to BETA server
run-name: Deploy by @${{ github.actor }}

# That should be executed on create: tag event
on:
workflow_dispatch:

env:
ENVIRONMENT: "beta"
CARDANO_NETWORK: "sanchonet"
DOMAIN: "sanchogov.tools"

jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./scripts/govtool
env:
DBSYNC_POSTGRES_DB: "cexplorer"
DBSYNC_POSTGRES_USER: "postgres"
DBSYNC_POSTGRES_PASSWORD: "pSa8JCpQOACMUdGb"
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}
GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }}
GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }}
NGINX_BASIC_AUTH: ${{ secrets.NGINX_BASIC_AUTH }}
SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }}
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
GTM_ID: ${{ secrets.GTM_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }}
PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }}
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Login to AWS ECR
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: eu-west-1

- name: Setup SSH agent
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }}

- name: Deploy app
run: |
make --debug=b all
- name: Reprovision Grafana
run: |
sleep 30 # give grafana time to start up
make --debug=b reload-grafana
64 changes: 64 additions & 0 deletions .github/workflows/build-and-deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build and deploy GovTool to DEV server
run-name: Deploy by @${{ github.actor }}

on:
workflow_dispatch:

env:
ENVIRONMENT: "dev"
CARDANO_NETWORK: "sanchonet"
DOMAIN: "dev-sanchonet.govtool.byron.network"

jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./scripts/govtool
env:
DBSYNC_POSTGRES_DB: "cexplorer"
DBSYNC_POSTGRES_USER: "postgres"
DBSYNC_POSTGRES_PASSWORD: "pSa8JCpQOACMUdGb"
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}
GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }}
GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }}
NGINX_BASIC_AUTH: ${{ secrets.NGINX_BASIC_AUTH }}
SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }}
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
GTM_ID: ${{ secrets.GTM_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }}
PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }}
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Login to AWS ECR
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: eu-west-1

- name: Setup SSH agent
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }}

- name: Deploy app
run: |
make --debug=b all
- name: Reprovision Grafana
run: |
sleep 30 # give grafana time to start up
make --debug=b reload-grafana
66 changes: 66 additions & 0 deletions .github/workflows/build-and-deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build and deploy GovTool to STAGING server
run-name: Deploy by @${{ github.actor }}

on:
push:
branches:
- staging

env:
ENVIRONMENT: "staging"
CARDANO_NETWORK: "sanchonet"
DOMAIN: "staging.govtool.byron.network"

jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./scripts/govtool
env:
DBSYNC_POSTGRES_DB: "cexplorer"
DBSYNC_POSTGRES_USER: "postgres"
DBSYNC_POSTGRES_PASSWORD: "pSa8JCpQOACMUdGb"
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}
GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }}
GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }}
NGINX_BASIC_AUTH: ${{ secrets.NGINX_BASIC_AUTH }}
SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }}
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
GTM_ID: ${{ secrets.GTM_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }}
PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }}
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Login to AWS ECR
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: eu-west-1

- name: Setup SSH agent
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }}

- name: Deploy app
run: |
make --debug=b all
- name: Reprovision Grafana
run: |
sleep 30 # give grafana time to start up
make --debug=b reload-grafana
66 changes: 66 additions & 0 deletions .github/workflows/build-and-deploy-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build and deploy GovTool to TEST server
run-name: Deploy by @${{ github.actor }}

on:
push:
branches:
- test

env:
ENVIRONMENT: "test"
CARDANO_NETWORK: "sanchonet"
DOMAIN: "test-sanchonet.govtool.byron.network"

jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./scripts/govtool
env:
DBSYNC_POSTGRES_DB: "cexplorer"
DBSYNC_POSTGRES_USER: "postgres"
DBSYNC_POSTGRES_PASSWORD: "pSa8JCpQOACMUdGb"
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}
GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }}
GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }}
NGINX_BASIC_AUTH: ${{ secrets.NGINX_BASIC_AUTH }}
SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }}
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
GTM_ID: ${{ secrets.GTM_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }}
PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }}
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Login to AWS ECR
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: eu-west-1

- name: Setup SSH agent
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }}

- name: Deploy app
run: |
make --debug=b all
- name: Reprovision Grafana
run: |
sleep 30 # give grafana time to start up
make --debug=b reload-grafana
Loading

0 comments on commit 4e0ebe1

Please sign in to comment.