Compare commits
7 Commits
neoloc/dep
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| cbaa137eb6 | |||
| 33bd638c59 | |||
| 0b5e5fc1db | |||
| bb2cae29fd | |||
| 375fba6323 | |||
| 9cb07d9cef | |||
| 809d26349b |
@ -2,9 +2,6 @@ name: Build
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
@ -1,33 +0,0 @@
|
|||||||
name: Deploy
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: almalinux-8
|
|
||||||
container:
|
|
||||||
image: git.query.consul/unkin/almalinux8-runnerdnd:latest
|
|
||||||
options: --privileged
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Download Build Artifacts
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: plans
|
|
||||||
path: /workspace/unkin/terraform-nomad/plans
|
|
||||||
|
|
||||||
- name: Install Packages
|
|
||||||
run: |
|
|
||||||
dnf install terraform terragrunt vault jq -y
|
|
||||||
|
|
||||||
- name: Run Terraform Apply
|
|
||||||
env:
|
|
||||||
VAULT_ROLEID: ${{ secrets.TERRAFORM_NOMAD_VAULT_ROLEID }}
|
|
||||||
run: |
|
|
||||||
make apply
|
|
||||||
@ -6,6 +6,7 @@ inputs = {
|
|||||||
job_files = [
|
job_files = [
|
||||||
"testapp1",
|
"testapp1",
|
||||||
"testapp2",
|
"testapp2",
|
||||||
|
"app-sudaporn-research-normalised",
|
||||||
]
|
]
|
||||||
policy_files = []
|
policy_files = []
|
||||||
}
|
}
|
||||||
|
|||||||
71
jobs/app-sudaporn-research-normalised.hcl
Normal file
71
jobs/app-sudaporn-research-normalised.hcl
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
job "app-sudaporn-research-normalised" {
|
||||||
|
datacenters = ["au-syd1"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "app" {
|
||||||
|
count = 2
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "http" {
|
||||||
|
to = 80
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
update {
|
||||||
|
max_parallel = 1
|
||||||
|
health_check = "checks"
|
||||||
|
min_healthy_time = "30s"
|
||||||
|
healthy_deadline = "5m"
|
||||||
|
progress_deadline = "10m"
|
||||||
|
auto_revert = true
|
||||||
|
auto_promote = true
|
||||||
|
canary = 1
|
||||||
|
stagger = "20s"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Ensure instances run on different agents
|
||||||
|
spread {
|
||||||
|
attribute = "${node.unique.id}"
|
||||||
|
weight = 100
|
||||||
|
}
|
||||||
|
|
||||||
|
# Application Task
|
||||||
|
task "webapp" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "git.query.consul/unkin/almalinux9-base:latest"
|
||||||
|
network_mode = "bridge"
|
||||||
|
ports = ["http"]
|
||||||
|
command = "sh"
|
||||||
|
args = [
|
||||||
|
"-c",
|
||||||
|
"rm -rf /app && git clone https://git.query.consul/unkin/app-sudaporn-research-normalised.git /app && cd /app && make run"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
PORT = "80"
|
||||||
|
PYTHONUNBUFFERED = "1"
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 500
|
||||||
|
memory = 350
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "app-sudaporn-research-normalised"
|
||||||
|
port = "http"
|
||||||
|
address_mode = "driver"
|
||||||
|
|
||||||
|
check {
|
||||||
|
type = "http"
|
||||||
|
path = "/"
|
||||||
|
interval = "10s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user