Skip to content

Commit a9c9876

Browse files
authored
release the latest dev composer images (#280)
1 parent 27756a4 commit a9c9876

3 files changed

Lines changed: 43 additions & 13 deletions

File tree

.github/workflows/release-extensions-dev.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,6 @@ jobs:
8484
uses: ./.github/workflows/release-extensions-impl.yaml
8585
with:
8686
extensions: ${{ needs.detect-dev-changes.outputs.changed-extensions }}
87+
composer_image_name_suffix: -dev
88+
composer_image_tag: latest
8789
secrets: inherit

.github/workflows/release-extensions-impl.yaml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ on:
1818
[{"name":"composer","type":"go","path":"composer"}]
1919
required: true
2020
type: string
21+
composer_image_name_suffix:
22+
description: Optional suffix appended to the Composer image name.
23+
required: false
24+
default: ''
25+
type: string
26+
composer_image_tag:
27+
description: Optional override for the Composer image tag.
28+
required: false
29+
default: ''
30+
type: string
2131

2232
env:
2333
OCI_REGISTRY: ghcr.io/tetratelabs
@@ -62,15 +72,29 @@ jobs:
6272
6373
- name: Release Composer
6474
if: matrix.extension.name == 'composer'
75+
env:
76+
IMAGE_NAME_SUFFIX: ${{ inputs.composer_image_name_suffix }}
77+
IMAGE_TAG: ${{ inputs.composer_image_tag }}
6578
run: |
6679
echo "Releasing Composer extension"
67-
make -C extensions/composer push_image
80+
image_tag="${IMAGE_TAG}"
81+
if [ -z "${image_tag}" ]; then
82+
image_tag=$(grep '^version:' extensions/composer/manifest.yaml | sed 's/[^:]*:[[:space:]]*//g' | tr -d '"')
83+
fi
84+
make -C extensions/composer push_image IMAGE_NAME_SUFFIX="${IMAGE_NAME_SUFFIX}" IMAGE_TAG="${image_tag}"
6885
6986
- name: Release Composer Lite
7087
if: matrix.extension.name == 'composer'
7188
env:
7289
COMPOSER_LITE: true
73-
run: make -C extensions/composer push_image
90+
IMAGE_NAME_SUFFIX: ${{ inputs.composer_image_name_suffix }}
91+
IMAGE_TAG: ${{ inputs.composer_image_tag }}
92+
run: |
93+
image_tag="${IMAGE_TAG}"
94+
if [ -z "${image_tag}" ]; then
95+
image_tag=$(grep '^version:' extensions/composer/manifest.yaml | sed 's/[^:]*:[[:space:]]*//g' | tr -d '"')
96+
fi
97+
make -C extensions/composer push_image IMAGE_NAME_SUFFIX="${IMAGE_NAME_SUFFIX}" IMAGE_TAG="${image_tag}"
7498
7599
- name: Push Composer source code
76100
if: matrix.extension.name == 'composer'

extensions/composer/Makefile

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ GO_TEST_ARGS ?=
1313
# files do not get in the way
1414
GO_FILES=$(shell git ls-files --cached --others --exclude-standard | grep '\.go$$')
1515
.PHONY: format
16-
format:
16+
format:
1717
@echo "format => *.go"
1818
@$(GO_TOOL) golangci-lint fmt $(GO_FILES)
1919
@echo "licenses => **"
@@ -54,24 +54,28 @@ endif
5454
BOE_DATA_HOME ?= $(HOME)/.local/share/boe
5555

5656
# Labels for this plugin image.
57-
NAME := $(shell grep "^name:" manifest.yaml | sed 's/[^:]*:[[:space:]]*//g' | tr -d '"')
58-
VERSION := $(shell grep "^version:" manifest.yaml | sed 's/[^:]*:[[:space:]]*//g' | tr -d '"')
59-
DESCRIPTION := $(shell grep "^description:" manifest.yaml | sed 's/[^:]*:[[:space:]]*//g' | tr -d '"')
60-
TIMESTAMP := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
61-
COMMIT_SHA := $(shell git rev-parse HEAD 2>/dev/null || echo "unknown")
62-
AUTHOR := $(shell grep "^author:" manifest.yaml | sed 's/[^:]*:[[:space:]]*//g' | tr -d '"')
63-
COMPOSER_VERSION := $(VERSION)
64-
LICENSE := Apache-2.0
57+
NAME := $(shell grep "^name:" manifest.yaml | sed 's/[^:]*:[[:space:]]*//g' | tr -d '"')
58+
VERSION := $(shell grep "^version:" manifest.yaml | sed 's/[^:]*:[[:space:]]*//g' | tr -d '"')
59+
DESCRIPTION := $(shell grep "^description:" manifest.yaml | sed 's/[^:]*:[[:space:]]*//g' | tr -d '"')
60+
TIMESTAMP := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
61+
COMMIT_SHA := $(shell git rev-parse HEAD 2>/dev/null || echo "unknown")
62+
AUTHOR := $(shell grep "^author:" manifest.yaml | sed 's/[^:]*:[[:space:]]*//g' | tr -d '"')
63+
COMPOSER_VERSION := $(VERSION)
64+
LICENSE := Apache-2.0
65+
IMAGE_TAG ?= $(VERSION)
66+
IMAGE_NAME_SUFFIX ?=
6567

6668
HUB := $(or $(BOE_REGISTRY),$(OCI_REGISTRY)/built-on-envoy)
67-
IMAGE := $(HUB)/$(NAME):$(VERSION)$(IMAGE_NONCE)
69+
IMAGE_NAME := $(NAME)$(IMAGE_NAME_SUFFIX)
70+
IMAGE := $(HUB)/$(IMAGE_NAME):$(IMAGE_TAG)$(IMAGE_NONCE)
6871
SOURCE := https://$(subst ghcr.io,github.com,$(HUB))
6972

7073
# Option to build lite version of the loader.
7174
ifeq ($(strip $(COMPOSER_LITE)),true)
7275
DESCRIPTION := Go plugin loader.
7376
COMPOSER_BUILD_TAG := -tags lite
74-
IMAGE := $(HUB)/$(NAME)-lite:$(VERSION)$(IMAGE_NONCE)
77+
IMAGE_NAME := $(NAME)-lite$(IMAGE_NAME_SUFFIX)
78+
IMAGE := $(HUB)/$(IMAGE_NAME):$(IMAGE_TAG)$(IMAGE_NONCE)
7579
endif
7680

7781
OS := linux

0 commit comments

Comments
 (0)