Skip to content

Commit

Permalink
Dummy veilarbaktivitet app med postgres i gcp
Browse files Browse the repository at this point in the history
  • Loading branch information
holymaloney committed Jun 10, 2024
1 parent 7d40665 commit 44f27c5
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/dummy-gcp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and deploy
on:
push:
branches:
- gcp-premigrering
permissions:
contents: read
id-token: write
jobs:
build_and_deploy:
name: Build, push and deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Push docker image to GAR
uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: dab
owner: dab
dockerfile: dummy-app/Dockerfile
image_suffix: dummy
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} # Provided as Organization Secret
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} # Provided as Organization Variable
- name: Deploy to NAIS
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
APIKEY: ${{ secrets.DAB_NAIS_DEPLOY_APIKEY }}
RESOURCE: nais/nais-dev-gcp.yaml
VAR: image=${{ steps.docker-build-push.outputs.image }}
10 changes: 10 additions & 0 deletions dummy-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM busybox:latest
ENV PORT=8080

ADD ./dummy-app/www/index.html /www/index.html
ADD ./dummy-app/www/hello-nais.png /www/hello-nais.png

HEALTHCHECK CMD nc -z localhost $PORT

# Create a basic webserver and run it until the container is stopped
CMD echo "httpd started" && trap "exit 0;" TERM INT; httpd -v -p $PORT -h /www -f & wait
Binary file added dummy-app/www/hello-nais.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions dummy-app/www/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: rgb(125, 159, 169);
}
.center {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
</style>
</head>
<body>
<div class="center">
<img src="hello-nais.png" alt="Hello Nais">
</div>
</body>
</html>
28 changes: 28 additions & 0 deletions nais/nais-dev-gcp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: nais.io/v1alpha1
kind: Application

metadata:
name: veilarbaktivitet
namespace: dab
labels:
team: dab
spec:
ingresses:
- https://veilarbaktivitet.dev.nav.cloud.nais.io
image: {{image}}
port: 8080
ttl: 3h
replicas:
max: 1
min: 1
resources:
requests:
cpu: 50m
memory: 32Mi
gcp:
sqlInstances:
- name: veilarbaktivitet
type: POSTGRES_14
databases:
- name: veilarbaktivitet
envVarPrefix: DB

0 comments on commit 44f27c5

Please sign in to comment.