Skip to content

Commit

Permalink
Tolerate v prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Rockwood <[email protected]>
  • Loading branch information
benr committed Oct 6, 2023
1 parent e1da653 commit 62328e4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 19 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/build_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ jobs:
uses: WyriHaximus/github-action-get-previous-tag@v1

- name: Parse semver string
id: semver
id: semver
uses: booxmedialtd/ws-action-parse-semver@v1
with:
input_string: ${{ steps.vars.outputs.tag }}
- name: Clean Version Tag
id: version
run: |
VERSION=$(echo "${{ steps.vars.outputs.tag }}" | sed -e 's/^v//'')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -41,20 +47,20 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push root images
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
push: true
build-args: VERSION=${{ steps.vars.outputs.tag }}
build-args: VERSION=${{ steps.version.outputs.version }}
target: root
tags: |
mondoolabs/mondoo:${{ steps.vars.outputs.tag }}
mondoolabs/mondoo:${{ steps.version.outputs.version }}
mondoolabs/mondoo:${{ steps.semver.outputs.major }}
mondoolabs/mondoo:latest
mondoo/client:${{ steps.vars.outputs.tag }}
mondoo/client:${{ steps.version.outputs.version }}
mondoo/client:${{ steps.semver.outputs.major }}
mondoo/client:latest
Expand All @@ -64,10 +70,10 @@ jobs:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
push: true
build-args: VERSION=${{ steps.vars.outputs.tag }}
build-args: VERSION=${{ steps.version.outputs.version }}
target: rootless
tags: |
mondoo/client:${{ steps.vars.outputs.tag }}-rootless
mondoo/client:${{ steps.version.outputs.version }}-rootless
mondoo/client:${{ steps.semver.outputs.major }}-rootless
mondoo/client:latest-rootless
Expand All @@ -78,10 +84,10 @@ jobs:
file: Dockerfile-ubi
platforms: linux/amd64,linux/arm64
push: true
build-args: VERSION=${{ steps.vars.outputs.tag }}
build-args: VERSION=${{ steps.version.outputs.version }}
target: root
tags: |
mondoo/client:${{ steps.vars.outputs.tag }}-ubi
mondoo/client:${{ steps.version.outputs.version }}-ubi
mondoo/client:${{ steps.semver.outputs.major }}-ubi
mondoo/client:latest-ubi
Expand All @@ -92,10 +98,10 @@ jobs:
file: Dockerfile-ubi
platforms: linux/amd64,linux/arm64
push: true
build-args: VERSION=${{ steps.vars.outputs.tag }}
build-args: VERSION=${{ steps.version.outputs.version }}
target: rootless
tags: |
mondoo/client:${{ steps.vars.outputs.tag }}-ubi-rootless
mondoo/client:${{ steps.version.outputs.version }}-ubi-rootless
mondoo/client:${{ steps.semver.outputs.major }}-ubi-rootless
mondoo/client:latest-ubi-rootless
23 changes: 15 additions & 8 deletions .github/workflows/edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
version:
description: 'Mondoo client version'
description: 'Mondoo client version'
required: true

jobs:
Expand All @@ -13,6 +13,13 @@ jobs:
timeout-minutes: 10
name: Build Docker
steps:
- name: Clean Version
id: version
run: |
VERSON=${{ steps.version.outputs.version | replace('v', '') }}
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Clone repository
uses: actions/checkout@v4
with:
Expand All @@ -32,19 +39,19 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push root images (alpine)
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/386,linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
push: true
build-args: |
BASEURL=https://releases.mondoo.com/edge/mondoo/${{ github.event.inputs.version }}
VERSION=${{ github.event.inputs.version }}
BASEURL=https://releases.mondoo.com/edge/mondoo/${{ steps.version.outputs.version }}
VERSION=${{ steps.version.outputs.version }}
target: root
tags: |
mondoo/client:edge-${{ github.event.inputs.version }}
mondoo/client:edge-${{ steps.version.outputs.version }}
mondoo/client:edge-latest
- name: Build and push rootless images (alpine)
Expand All @@ -54,9 +61,9 @@ jobs:
platforms: linux/386,linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
push: true
build-args: |
BASEURL=https://releases.mondoo.com/edge/mondoo/${{ github.event.inputs.version }}
VERSION=${{ github.event.inputs.version }}
BASEURL=https://releases.mondoo.com/edge/mondoo/${{ steps.version.outputs.version }}
VERSION=${{ steps.version.outputs.version }}
target: rootless
tags: |
mondoo/client:edge-${{ github.event.inputs.version }}-rootless
mondoo/client:edge-${{ steps.version.outputs.version }}-rootless
mondoo/client:edge-latest-rootless

0 comments on commit 62328e4

Please sign in to comment.