version changes
This commit is contained in:
19
.github/workflows/pipeline.yml
vendored
19
.github/workflows/pipeline.yml
vendored
@@ -47,15 +47,6 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
type=raw,value=latest
|
type=raw,value=latest
|
||||||
|
|
||||||
# - name: Setup Docker Metadata
|
|
||||||
# id: meta
|
|
||||||
# uses: docker/metadata-action@v4
|
|
||||||
# with:
|
|
||||||
# images: liamsgit.dev/LiamPietralla/code-snippets
|
|
||||||
# tags: |
|
|
||||||
# type=raw,value=latest
|
|
||||||
# type=sha,value=${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Login to Registry
|
- name: Login to Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -86,16 +77,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
nomad_version: '1.10.5'
|
nomad_version: '1.10.5'
|
||||||
|
|
||||||
# - name: Deploy Job to Nomad
|
|
||||||
# run: |
|
|
||||||
# nomad job run -var="version=${{ github.sha }}" infra/nomad/code-snippets.nomad.hcl
|
|
||||||
# env:
|
|
||||||
# NOMAD_ADDR: ${{ vars.NOMAD_ADDR }}
|
|
||||||
# NOMAD_TOKEN: ${{ secrets.NOMAD_TOKEN }}
|
|
||||||
|
|
||||||
- name: Deploy Job to Nomad
|
- name: Deploy Job to Nomad
|
||||||
run: |
|
run: |
|
||||||
nomad job run infra/nomad/code-snippets.nomad.hcl
|
export DEPLOYMENT_VERSION="${GITHUB_SHA:0:7}-$(date +%s)"
|
||||||
|
nomad job run -var="deployment_version=$DEPLOYMENT_VERSION" infra/nomad/code-snippets.nomad.hcl
|
||||||
env:
|
env:
|
||||||
NOMAD_ADDR: ${{ vars.NOMAD_ADDR }}
|
NOMAD_ADDR: ${{ vars.NOMAD_ADDR }}
|
||||||
NOMAD_TOKEN: ${{ secrets.NOMAD_TOKEN }}
|
NOMAD_TOKEN: ${{ secrets.NOMAD_TOKEN }}
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
variable "version" {
|
variable "deployment_version" {
|
||||||
type = string
|
type = string
|
||||||
default = "latest"
|
description = "The deployment version from CI/CD"
|
||||||
|
default = "unknown"
|
||||||
}
|
}
|
||||||
|
|
||||||
job "code-snippets" {
|
job "code-snippets" {
|
||||||
datacenters = ["dc1"]
|
datacenters = ["dc1"]
|
||||||
type = "service"
|
type = "service"
|
||||||
|
|
||||||
|
meta {
|
||||||
|
version = var.deployment_version
|
||||||
|
}
|
||||||
|
|
||||||
constraint {
|
constraint {
|
||||||
operator = "="
|
operator = "="
|
||||||
attribute = "${meta.machine_role}"
|
attribute = "${meta.machine_role}"
|
||||||
@@ -26,7 +31,7 @@ job "code-snippets" {
|
|||||||
driver = "docker"
|
driver = "docker"
|
||||||
|
|
||||||
config {
|
config {
|
||||||
image = "liamsgit.dev/liampietralla/code-snippets:${var.version}"
|
image = "liamsgit.dev/liampietralla/code-snippets:latest"
|
||||||
force_pull = true
|
force_pull = true
|
||||||
ports = ["http"]
|
ports = ["http"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user