[CI-Only] Support per-commit dev images and fossa scanning (#2255)

This commit is contained in:
Michele Degges authored and GitHub committed 2022-07-19 15:23:50 -07:00
1 parent a17e973712
commit e7a32ebd68
2 files changed
+45 -7

No files matched your search

+22 -7
View File
@@ -16,6 +16,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
product-version: ${{ steps.get-product-version.outputs.product-version }} product-version: ${{ steps.get-product-version.outputs.product-version }}
product-minor-version: ${{ steps.get-product-version.outputs.product-minor-version }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Setup go - name: Setup go
@@ -25,8 +26,19 @@ jobs:
- name: get product version - name: get product version
id: get-product-version id: get-product-version
run: | run: |
make version VERSION=$(make version)
echo "::set-output name=product-version::$(make version)" MINOR_VERSION=${VERSION%.*}
echo "::set-output name=product-version::$VERSION"
echo "::set-output name=product-minor-version::$MINOR_VERSION"
verify-product-version:
needs: get-product-version
runs-on: ubuntu-latest
steps:
- name: Verify version strings
run: |
echo product-version: ${{ needs.get-product-version.outputs.product-version }}
echo minor-version: ${{ needs.get-product-version.outputs.product-minor-version }}
generate-metadata-file: generate-metadata-file:
needs: get-product-version needs: get-product-version
@@ -291,11 +303,9 @@ jobs:
env: env:
repo: ${{ github.event.repository.name }} repo: ${{ github.event.repository.name }}
version: ${{ needs.get-product-version.outputs.product-version }} version: ${{ needs.get-product-version.outputs.product-version }}
minor-version: ${{ needs.get-product-version.outputs.product-minor-version }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Replace + in version
run: |
echo "dockerversion=$(echo ${{ needs.get-product-version.outputs.product-version }} | sed 's/+ent/-ent/g')" >> $GITHUB_ENV
- name: Docker Build (Action) - name: Docker Build (Action)
uses: hashicorp/actions-docker-build@v1 uses: hashicorp/actions-docker-build@v1
with: with:
@@ -303,5 +313,10 @@ jobs:
target: default target: default
arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
tags: | tags: |
docker.io/hashicorp/${{ env.repo }}:${{ env.dockerversion }} docker.io/hashicorp/${{ env.repo }}:${{ env.version }}
public.ecr.aws/hashicorp/${{ env.repo }}:${{ env.dockerversion }} public.ecr.aws/hashicorp/${{ env.repo }}:${{ env.version }}
# Per-commit dev images follow the naming convention MAJOR.MINOR-dev
# And MAJOR.MINOR-dev-$COMMITSHA
dev_tags: |
docker.io/hashicorppreview/${{ env.repo }}:${{ env.minor-version }}-dev
docker.io/hashicorppreview/${{ env.repo }}:${{ env.minor-version }}-dev-${{ github.sha }}
+23
View File
@@ -174,6 +174,29 @@ event "verify" {
} }
} }
event "promote-dev-docker" {
depends = ["verify"]
action "promote-dev-docker" {
organization = "hashicorp"
repository = "crt-workflows-common"
workflow = "promote-dev-docker"
depends = ["verify"]
}
notification {
on = "fail"
}
}
event "fossa-scan" {
depends = ["promote-dev-docker"]
action "fossa-scan" {
organization = "hashicorp"
repository = "crt-workflows-common"
workflow = "fossa-scan"
}
}
## These are promotion and post-publish events ## These are promotion and post-publish events
## they should be added to the end of the file after the verify event stanza. ## they should be added to the end of the file after the verify event stanza.