Skip to content

Commit

Permalink
feat(esm): add consul external services management job (#120)
Browse files Browse the repository at this point in the history
feat(esm): add consul external services management job
ci: update tailscale version in CI runners
chore: update pre-commit hooks and add github workflows check
refactor(esm): move hardcoded version to variable
fix(esm): add migration, update and scaling stanzas
fix(esm): tune requirements for job
chore: bump version back to 0.7.1

---------

Signed-off-by: Bruce Becker <[email protected]>
  • Loading branch information
brucellino authored Mar 25, 2024
1 parent 4c99982 commit f747eaa
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
oauth-client-id: ${{ secrets.TAILSCALE_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TAILSCALE_OAUTH_KEY }}
tags: tag:ci
version: 1.58.2
- name: check connectivity
run: ifconfig ; host sense.orca-ordinal.ts.net
- name: Checkout change
Expand Down
15 changes: 10 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
hooks:
- id: check-github-workflows

- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v8.0.0
rev: v9.13.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ['@commitlint/config-conventional']
additional_dependencies: ['@commitlint/config-conventional', '@commitlint/cli']

- repo: https://github.com/Yelp/detect-secrets
rev: v1.2.0
rev: v1.4.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']

- repo: https://github.com/tfsec/tfsec
rev: v1.26.3
rev: v1.28.5
hooks:
- id: tfsec-system
- repo: local
Expand Down
2 changes: 1 addition & 1 deletion .secrets.baseline
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.2.0",
"version": "1.4.0",
"plugins_used": [
{
"name": "ArtifactoryDetector"
Expand Down
59 changes: 59 additions & 0 deletions consul-esm.nomad
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
variable "consul_esm_version" {
type = string
default = "0.7.1"
}

job "consul-esm" {
group "main" {

count = 1

update {
max_parallel = 1
health_check = "checks"
min_healthy_time = "20s"
healthy_deadline = "5m"
auto_revert = true
auto_promote = true
canary = 1
}

migrate {
max_parallel = 1
health_check = "checks"
min_healthy_time = "10s"
healthy_deadline = "5m"
}

task "monitor" {

// scaling {
// enabled = true
// min = 0
// max = 3
// policy {

// }
// }

driver = "exec"
config {
command = "local/consul-esm"
}
artifact {
source = "https://releases.hashicorp.com/consul-esm/${var.consul_esm_version}/consul-esm_${var.consul_esm_version}_linux_arm64.zip"
destination = "local/consul-esm"
mode = "file"
}
identity {
env = true
file = true
}

resources {
cpu = 50
memory = 25
}
}
}
}

0 comments on commit f747eaa

Please sign in to comment.