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

Commit

Permalink
Merge pull request #387 from navikt/move_from_sbs_to_gcp
Browse files Browse the repository at this point in the history
Starter flytting til gcp
  • Loading branch information
maccyber authored Jan 19, 2022
2 parents e280948 + e444f21 commit d2703a9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 21 deletions.
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

0 comments on commit d2703a9

Please sign in to comment.