12 Commits

Author SHA1 Message Date
unkinben cbaa137eb6 Merge pull request 'feat: add app-sudaporn-research-normalised' (#6) from neoloc/appsdeploy_sudaporn into master
Reviewed-on: https://git.query.consul/unkin/terraform-nomad/pulls/6
2025-03-09 19:12:28 +11:00
unkinben 33bd638c59 feat: add app-sudaporn-research-normalised
Build / build (pull_request) Successful in 1m9s
- application for Sudaporn's research
2025-03-09 19:10:02 +11:00
unkinben 0b5e5fc1db Merge pull request 'feat: check if zip file is valid' (#5) from neoloc/test_if_zip_is_real into master
Reviewed-on: https://git.query.consul/unkin/terraform-nomad/pulls/5
2024-12-30 01:59:28 +11:00
unkinben bb2cae29fd feat: remove deploy.yaml workflow
Build / build (pull_request) Successful in 39s
- unable to complete successfully
2024-12-30 01:56:55 +11:00
unkinben 375fba6323 Merge pull request 'feat: wait for artifacts to be created' (#4) from neoloc/deploy_workflow2 into master
Deploy / deploy (push) Failing after 4s
Build / build (push) Successful in 39s
Reviewed-on: https://git.query.consul/unkin/terraform-nomad/pulls/4
2024-12-30 00:23:49 +11:00
unkinben 9cb07d9cef feat: wait for artifacts to be created
Build / build (pull_request) Successful in 39s
2024-12-30 00:22:34 +11:00
unkinben 809d26349b Merge pull request 'fix: update deployment' (#3) from neoloc/deploy_workflow into master
Build / build (push) Successful in 37s
Deploy / deploy (push) Failing after 1m10s
Reviewed-on: https://git.query.consul/unkin/terraform-nomad/pulls/3
2024-12-28 22:58:25 +11:00
unkinben 63cc96d602 fix: update deployment
Build / build (pull_request) Successful in 39s
2024-12-28 22:57:17 +11:00
unkinben 4db2abc990 Merge pull request 'fix: ensure deploy workflow runs' (#2) from neoloc/deploy_workflow into master
Build / build (push) Successful in 39s
Deploy / deploy (push) Has been skipped
Reviewed-on: https://git.query.consul/unkin/terraform-nomad/pulls/2
2024-12-28 22:47:45 +11:00
unkinben f7fa3bbd47 fix: ensure deploy workflow runs
Build / build (pull_request) Successful in 39s
- changed `on` params
2024-12-28 22:46:20 +11:00
unkinben 2a20398c87 Merge pull request 'feat: initial setup' (#1) from neoloc/initial into master
Reviewed-on: https://git.query.consul/unkin/terraform-nomad/pulls/1
2024-12-28 22:43:19 +11:00
unkinben 3fe7ea4c36 feat: initial setup
Build / build (pull_request) Successful in 42s
- manage nomad jobs
- create makefile
- create gitignore
- manage terragrunt environments
- add build/deploy jobs
2024-12-28 22:39:53 +11:00
4 changed files with 81 additions and 9 deletions
+6 -6
View File
@@ -14,7 +14,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Terraform/Terragrunt
- name: Install Packages
run: |
dnf install terraform terragrunt vault jq -y
@@ -28,9 +28,9 @@ jobs:
run: |
find /workspace -type f -name "*.plan"
#- name: Upload Artifacts
# uses: actions/upload-artifact@v3
# with:
# name: plans
# path: /workspace/unkin/rpmbuilder/dist/*/*.rpm
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: plans
path: /workspace/unkin/terraform-nomad/plans/*.plan
+3 -3
View File
@@ -20,14 +20,14 @@ clean:
rm -rf plans
init:
$(call vault_env)
$(call vault_env) && \
terragrunt --terragrunt-working-dir $(ENV_DIR) init
plan: init
@mkdir -p $(PLAN_DIR)
$(call vault_env)
$(call vault_env) && \
terragrunt --terragrunt-working-dir $(ENV_DIR) plan -out=$(PLAN_FILE)
apply:
$(call vault_env)
$(call vault_env) && \
terragrunt --terragrunt-working-dir $(ENV_DIR) apply $(PLAN_FILE)
+1
View File
@@ -6,6 +6,7 @@ inputs = {
job_files = [
"testapp1",
"testapp2",
"app-sudaporn-research-normalised",
]
policy_files = []
}
+71
View 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"
}
}
}
}
}