Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Starter flytting til gcp #387

Merged
merged 1 commit into from
Jan 19, 2022
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
7 changes: 4 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:
push:
branches:
- main
- 'preprod/**'

env:
IMAGE: ghcr.io/${{ github.repository }}/sporenstreks-frontend:${{ github.sha }}
IMAGE: ghcr.io/${{ github.repository }}/${{ github.event.repository.name }}:${{ github.sha }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
Expand Down Expand Up @@ -73,15 +74,15 @@ jobs:
docker push ${{ env.IMAGE }}

Deploy:
name: Deploy til PREPROD
name: Deploy til dev-gcp
needs: Docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-sbs
CLUSTER: dev-gcp
RESOURCE: deploy/dev.yaml
TEAM: helsearbeidsgiver
REF: ${{ env.COMMIT }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [published]

env:
IMAGE: ghcr.io/${{ github.repository }}/sporenstreks-frontend:${{ github.sha }}
IMAGE: ghcr.io/${{ github.repository }}/${{ github.event.repository.name }}:${{ github.sha }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
docker push ${{ env.IMAGE }}

Deploy:
name: Deploy
name: Deploy to prod-gcp
needs: [Docker]
runs-on: ubuntu-latest
steps:
Expand All @@ -88,6 +88,6 @@ jobs:
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-sbs
CLUSTER: prod-gcp
RESOURCE: deploy/prod.yaml
TEAM: helsearbeidsgiver
11 changes: 7 additions & 4 deletions deploy/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ spec:
cpu: 400m
memory: 256Mi
vault:
enabled: true
paths:
- kvPath: apikey/apigw/dev/sporenstreks/sporenstreks-frontend_q1
mountPath: /apigw/sporenstreks
enabled: false
accessPolicy:
outbound:
external:
- host: api-gw-q1.oera.no
envFrom:
- sporenstreks-frontend-api-gw-key
env:
- name: API_GATEWAY
value: https://api-gw-q1.oera.no/sporenstreks
11 changes: 7 additions & 4 deletions deploy/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ spec:
cpu: 200m
memory: 256Mi
vault:
enabled: true
paths:
- kvPath: apikey/apigw/prod/sporenstreks/sporenstreks-frontend
mountPath: /apigw/sporenstreks
enabled: false
accessPolicy:
outbound:
external:
- host: api-gw.oera.no
envFrom:
- sporenstreks-frontend-api-gw-key
env:
- name: API_GATEWAY
value: https://api-gw.oera.no/sporenstreks
8 changes: 1 addition & 7 deletions nginx/20-envsubst-on-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@

set -e

export GATEWAY_KEY="noGatewayKey"

if test -d /apigw/sporenstreks;
then
export GATEWAY_KEY=$(cat /apigw/sporenstreks/x-nav-apiKey)
fi

export GATEWAY_KEY=${X_NAV_APIKEY:-noGatewayKey}
export API_GATEWAY="${API_GATEWAY:-http://localhost:8080}"

ME=$(basename $0)
Expand Down