-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
212 additions
and
14 deletions.
There are no files selected for viewing
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
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,32 @@ | ||
name: LIVE - Tag and Deploy | ||
|
||
on: | ||
# pull_request: | ||
# branches: | ||
# - development | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Log in to Github Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
- name: Tag latest | ||
run: | | ||
docker pull ${{ secrets.DOCKER_HUB_USERNAME }}/metrics-service:latest-stage | ||
docker tag ${{ secrets.DOCKER_HUB_USERNAME }}/metrics-service:latest-stage ${{ secrets.DOCKER_HUB_USERNAME }}/metrics-service:latest | ||
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/metrics-service:latest | ||
- name: Deploy | ||
uses: ./.github/actions/deploy | ||
with: | ||
environment: live | ||
nomad-cacert: operations/admin-ui-ca.crt | ||
nomad-token: ${{ secrets.NOMAD_TOKEN_METRICS_SERVICE_DEPLOY }} | ||
nomad-addr: ${{ secrets.NOMAD_DEPLOY_ADDR }} |
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,31 @@ | ||
name: STAGE - Build and Deploy | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- development | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
- name: Build and push | ||
uses: ./.github/actions/build-and-push | ||
with: | ||
docker-username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
docker-password: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
docker-tag: latest-stage | ||
- name: Deploy | ||
uses: ./.github/actions/deploy | ||
with: | ||
environment: stage | ||
nomad-cacert: operations/admin-ui-ca.crt | ||
nomad-token: ${{ secrets.NOMAD_TOKEN_METRICS_SERVICE_DEPLOY }} | ||
nomad-addr: ${{ secrets.NOMAD_DEPLOY_ADDR }} |
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,65 @@ | ||
job "metrics-service-dev" { | ||
datacenters = ["ator-fin"] | ||
type = "service" | ||
namespace = "ator-network" | ||
|
||
group "metrics-service-dev-group" { | ||
count = 1 | ||
|
||
network { | ||
mode = "bridge" | ||
port "http-port" { | ||
static = 9033 | ||
to = 3000 | ||
#host_network = "wireguard" | ||
} | ||
} | ||
|
||
task "metrics-service-dev-task" { | ||
driver = "docker" | ||
|
||
template { | ||
data = <<EOH | ||
{{- range nomadService "victoriametrics-db" }} | ||
VICTORIA_METRICS_ADDRESS="http://{{ .Address }}:{{ .Port }}" | ||
{{ end -}} | ||
CLUSTER="local" | ||
ENV="main" | ||
INSTANCE="10.1.244.1:9190" | ||
JOB="consulagentonionoo" | ||
EOH | ||
destination = "secrets/file.env" | ||
env = true | ||
} | ||
|
||
config { | ||
image = "svforte/metrics-service:latest-dev" | ||
force_pull = true | ||
ports = ["http-port"] | ||
} | ||
|
||
resources { | ||
cpu = 256 | ||
memory = 256 | ||
} | ||
|
||
service { | ||
name = "metrics-service-dev" | ||
port = "http-port" | ||
check { | ||
name = "Metrics service check" | ||
type = "tcp" | ||
port = "http-port" | ||
path = "/" | ||
interval = "10s" | ||
timeout = "10s" | ||
check_restart { | ||
limit = 10 | ||
grace = "30s" | ||
} | ||
} | ||
} | ||
} | ||
|
||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
job "metrics-service-stage" { | ||
datacenters = ["ator-fin"] | ||
type = "service" | ||
namespace = "ator-network" | ||
|
||
group "metrics-service-stage-group" { | ||
count = 1 | ||
|
||
network { | ||
mode = "bridge" | ||
port "http-port" { | ||
static = 9133 | ||
to = 3000 | ||
#host_network = "wireguard" | ||
} | ||
} | ||
|
||
task "metrics-service-stage-task" { | ||
driver = "docker" | ||
|
||
template { | ||
data = <<EOH | ||
{{- range nomadService "victoriametrics-db" }} | ||
VICTORIA_METRICS_ADDRESS="http://{{ .Address }}:{{ .Port }}" | ||
{{ end -}} | ||
CLUSTER="local" | ||
ENV="main" | ||
INSTANCE="10.1.244.1:9190" | ||
JOB="consulagentonionoo" | ||
EOH | ||
destination = "secrets/file.env" | ||
env = true | ||
} | ||
|
||
config { | ||
image = "svforte/metrics-service:latest-stage" | ||
force_pull = true | ||
ports = ["http-port"] | ||
} | ||
|
||
resources { | ||
cpu = 256 | ||
memory = 256 | ||
} | ||
|
||
service { | ||
name = "metrics-service-stage" | ||
port = "http-port" | ||
check { | ||
name = "Metrics service check" | ||
type = "tcp" | ||
port = "http-port" | ||
path = "/" | ||
interval = "10s" | ||
timeout = "10s" | ||
check_restart { | ||
limit = 10 | ||
grace = "30s" | ||
} | ||
} | ||
} | ||
} | ||
|
||
} | ||
} |