-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #379 from datasektionen/main
Bring prod up to speed with main
- Loading branch information
Showing
11 changed files
with
143 additions
and
82 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Deploy to Preview Environment | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to Nomad | ||
uses: datasektionen/nomad-deploy@v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
nomad-token: ${{ secrets.NOMAD_TOKEN }} | ||
nomad-addr: ${{ vars.NOMAD_ADDR }} | ||
job-file-path: preview.nomad.hcl | ||
image-tag: preview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Deploy to Production Environment | ||
|
||
on: | ||
push: | ||
branches: [ production ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to Nomad | ||
uses: datasektionen/nomad-deploy@v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
nomad-token: ${{ secrets.NOMAD_TOKEN }} | ||
nomad-addr: ${{ vars.NOMAD_ADDR }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
job "ddagen" { | ||
type = "service" | ||
namespace = "ddagen" | ||
|
||
group "ddagen" { | ||
network { | ||
port "http" { } | ||
} | ||
|
||
service { | ||
name = "ddagen" | ||
port = "http" | ||
provider = "nomad" | ||
tags = [ | ||
"traefik.enable=true", | ||
"traefik.http.routers.ddagen.rule=Host(`ddagen.se`)||Host(`www.ddagen.se`)", | ||
"traefik.http.routers.ddagen.tls.certresolver=default", | ||
] | ||
} | ||
|
||
task "ddagen" { | ||
driver = "docker" | ||
|
||
config { | ||
image = var.image_tag | ||
ports = ["http"] | ||
} | ||
|
||
template { | ||
data = <<ENV | ||
PORT={{ env "NOMAD_PORT_http" }} | ||
{{ with nomadVar "nomad/jobs/ddagen" }} | ||
DATABASE_URL=postgres://ddagen:{{ .db_password }}@postgres.dsekt.internal:5432/ddagen | ||
SPAM_API_KEY={{ .spam_api_key }} | ||
{{ end }} | ||
NODE_ENV=production | ||
PLS_URL=http://pls.nomad.dsekt.internal | ||
SPAM_URL=https://spam.datasektionen.se/api/sendmail | ||
ENV | ||
destination = "local/.env" | ||
env = true | ||
} | ||
} | ||
} | ||
} | ||
|
||
variable "image_tag" { | ||
type = string | ||
default = "ghcr.io/datasektionen/ddagen:latest" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
job "ddagen-dev" { | ||
type = "service" | ||
namespace = "ddagen" | ||
|
||
group "ddagen-dev" { | ||
network { | ||
port "http" { } | ||
} | ||
|
||
service { | ||
name = "ddagen-dev" | ||
port = "http" | ||
provider = "nomad" | ||
tags = [ | ||
"traefik.enable=true", | ||
"traefik.http.routers.ddagen-dev.rule=Host(`dev.ddagen.se`)", | ||
"traefik.http.routers.ddagen-dev.tls.certresolver=default", | ||
] | ||
} | ||
|
||
task "ddagen-dev" { | ||
driver = "docker" | ||
|
||
config { | ||
image = var.image_tag | ||
ports = ["http"] | ||
} | ||
|
||
template { | ||
data = <<ENV | ||
PORT={{ env "NOMAD_PORT_http" }} | ||
{{ with nomadVar "nomad/jobs/ddagen-dev" }} | ||
DATABASE_URL=postgres://ddagen-dev:{{ .db_password }}@postgres.dsekt.internal:5432/ddagen-dev | ||
SPAM_API_KEY={{ .spam_api_key }} | ||
{{ end }} | ||
NODE_ENV=production | ||
PLS_URL=http://pls.nomad.dsekt.internal | ||
SPAM_URL=https://spam.datasektionen.se/api/sendmail | ||
ENV | ||
destination = "local/.env" | ||
env = true | ||
} | ||
} | ||
} | ||
} | ||
|
||
variable "image_tag" { | ||
type = string | ||
default = "ghcr.io/datasektionen/ddagen:preview" | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters