Skip to content

Commit

Permalink
Merge branch 'main' into releng/migrate-to-prepare
Browse files Browse the repository at this point in the history
  • Loading branch information
angrycub committed Jun 12, 2024
2 parents 759e01e + 10061ff commit cdd0043
Show file tree
Hide file tree
Showing 14 changed files with 194 additions and 366 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: "Check workflow files"
uses: docker://docker.mirror.hashicorp.services/rhysd/actionlint:latest
26 changes: 11 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
outputs:
go-version: ${{ steps.get-go-version.outputs.go-version }}
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Determine Go version
id: get-go-version
run: |
Expand All @@ -23,7 +23,7 @@ jobs:
outputs:
product-version: ${{ steps.get-product-version.outputs.product-version }}
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: get product version
id: get-product-version
run: |
Expand All @@ -36,15 +36,15 @@ jobs:
filepath: ${{ steps.generate-metadata-file.outputs.filepath }}
steps:
- name: "Checkout directory"
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Generate metadata file
id: generate-metadata-file
uses: hashicorp/actions-generate-metadata@v1
with:
version: ${{ needs.get-product-version.outputs.product-version }}
product: ${{ env.PKG_NAME }}
repositoryOwner: "hashicorp"
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
if: ${{ !env.ACT }}
with:
name: metadata.json
Expand All @@ -55,7 +55,7 @@ jobs:
outputs:
ldflags: ${{ steps.generate-ldflags.outputs.ldflags }}
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Generate ld flags
id: generate-ldflags
run: |
Expand All @@ -71,16 +71,12 @@ jobs:
matrix:
goos: ["linux", "darwin", "windows", "freebsd"]
goarch: [ "amd64", "arm64"]
include:
- { goos: "linux", goarch: "386" }
- { goos: "linux", goarch: "arm" }
- { goos: "freebsd", goarch: "arm" }
fail-fast: true
name: Go ${{ needs.get-go-version.outputs.go-version }} ${{ matrix.goos }} ${{ matrix.goarch }} build
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: ".go-version"
- name: Determine artifact basename
Expand Down Expand Up @@ -121,13 +117,13 @@ jobs:
echo "RPM_PACKAGE=$(basename out/*.rpm)" >> "$GITHUB_ENV"
echo "DEB_PACKAGE=$(basename out/*.deb)" >> "$GITHUB_ENV"
- if: ${{ matrix.goos == 'linux' }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: ${{ env.RPM_PACKAGE }}
path: out/${{ env.RPM_PACKAGE }}
if-no-files-found: error
- if: ${{ matrix.goos == 'linux' }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: ${{ env.DEB_PACKAGE }}
path: out/${{ env.DEB_PACKAGE }}
Expand All @@ -139,13 +135,13 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
arch: ["arm", "arm64", "386", "amd64"]
arch: ["arm64", "amd64"]
fail-fast: true
env:
version: ${{ needs.get-product-version.outputs.product-version }}
name: Docker ${{ matrix.arch }} default release build
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Docker Build (Action)
uses: hashicorp/actions-docker-build@v1
with:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
GO_TAGS: ''
GO111MODULE: 'on'
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: ".go-version"
- name: Setup golangci-lint
Expand All @@ -21,8 +21,8 @@ jobs:
check-deps-go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: ".go-version"
- run: make check-mod
Expand All @@ -32,8 +32,8 @@ jobs:
GO_TAGS: ''
GO111MODULE: 'on'
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: ".go-version"
- run: make test
Expand All @@ -43,8 +43,8 @@ jobs:
GO_TAGS: ''
GO111MODULE: 'on'
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: ".go-version"
- run: make dev
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
needs: build-artifacts
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Download built artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
# If a release with this name already exists, it will overwrite the existing data
- name: Create a nightly GitHub prerelease
id: create_prerelease
uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # v1.12.0
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
with:
name: nightly
artifacts: "${{ env.BUILD_OUTPUT_LIST }}"
Expand Down Expand Up @@ -87,4 +87,4 @@ jobs:
status: failure
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
permissions:
contents: read
contents: write
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.4
1.21.1
23 changes: 16 additions & 7 deletions .release/ci.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,28 @@
schema = "1"

project "levant" {
// the team key is not used by CRT currently
team = "nomad"

slack {
notification_channel = "C03B5EWFW01"
}

github {
organization = "hashicorp"
repository = "levant"

release_branches = [
"main",
"release/**",
]
}
}


event "build" {}

event "prepare" {
depends = ["build"]

action "prepare" {
organization = "hashicorp"
repository = "crt-workflows-common"
Expand All @@ -31,24 +34,26 @@ event "prepare" {
}

notification {
on = "fail"
on = "always"
}
}

## These are promotion and post-publish events
## they should be added to the end of the file after the verify event stanza.

event "trigger-staging" {
// This event is dispatched by the bob trigger-promotion command
// and is required - do not delete.
# This event is dispatched by the bob trigger-promotion command
# and is required - do not delete.
}

event "promote-staging" {
depends = ["trigger-staging"]

action "promote-staging" {
organization = "hashicorp"
repository = "crt-workflows-common"
workflow = "promote-staging"
config = "release-metadata.hcl"
}

notification {
Expand All @@ -58,6 +63,7 @@ event "promote-staging" {

event "promote-staging-docker" {
depends = ["promote-staging"]

action "promote-staging-docker" {
organization = "hashicorp"
repository = "crt-workflows-common"
Expand All @@ -70,12 +76,13 @@ event "promote-staging-docker" {
}

event "trigger-production" {
// This event is dispatched by the bob trigger-promotion command
// and is required - do not delete.
# This event is dispatched by the bob trigger-promotion command
# and is required - do not delete.
}

event "promote-production" {
depends = ["trigger-production"]

action "promote-production" {
organization = "hashicorp"
repository = "crt-workflows-common"
Expand All @@ -89,6 +96,7 @@ event "promote-production" {

event "promote-production-docker" {
depends = ["promote-production"]

action "promote-production-docker" {
organization = "hashicorp"
repository = "crt-workflows-common"
Expand All @@ -102,6 +110,7 @@ event "promote-production-docker" {

event "promote-production-packaging" {
depends = ["promote-production-docker"]

action "promote-production-packaging" {
organization = "hashicorp"
repository = "crt-workflows-common"
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## UNRELEASED

## 0.3.3 (October 5, 2023)

IMPROVEMENTS:
* build: Now builds with Go v1.21.1 [[GH-507](https://github.com/hashicorp/levant/pull/507)]
* deps: Updated Nomad dependency to v1.6.2 [[GH-507](https://github.com/hashicorp/levant/pull/507)]

## 0.3.2 (October 20, 2022)

IMPROVEMENTS:
Expand Down
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SHELL = bash
default: lint test build check-mod
default: lint test check-mod dev

GIT_COMMIT := $(shell git rev-parse --short HEAD)
GIT_DIRTY := $(if $(shell git status --porcelain),+CHANGES)
Expand Down
5 changes: 3 additions & 2 deletions command/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ General Options:
default is HUMAN.
-var-file=<file>
Used in conjunction with the -job-file will deploy a templated job to your
Nomad cluster. You can repeat this flag multiple times to supply multiple var-files.
Path to a file containing user variables used when rendering the job
template. You can repeat this flag multiple times to supply multiple
var-files. Defaults to levant.(json|yaml|yml|tf).
[default: levant.(json|yaml|yml|tf)]
`
return strings.TrimSpace(helpText)
Expand Down
5 changes: 3 additions & 2 deletions command/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ General Options:
default is HUMAN.
-var-file=<file>
Used in conjunction with the -job-file will plan a templated job against your
Nomad cluster. You can repeat this flag multiple times to supply multiple var-files.
Path to a file containing user variables used when rendering the job
template. You can repeat this flag multiple times to supply multiple
var-files. Defaults to levant.(json|yaml|yml|tf).
[default: levant.(json|yaml|yml|tf)]
`
return strings.TrimSpace(helpText)
Expand Down
Loading

0 comments on commit cdd0043

Please sign in to comment.