Skip to content

Commit c762b40

Browse files
authored
Merge pull request #1 from ems-project/feat/5.x-improvements
Feat/5.x improvements
2 parents 9ee06bc + 853c930 commit c762b40

File tree

11 files changed

+524
-308
lines changed

11 files changed

+524
-308
lines changed

.build.env

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
ELASTICMS_CLIENT_VERSION=4.3.1
2-
DOCKER_IMAGE_NAME=docker.io/elasticms/cli
1+
# Default Docker image name
2+
DOCKER_IMAGE_NAME=docker.io/elasticms/cli
3+
4+
# Default ElasticMS CLI Version
5+
ELASTICMS_CLI_VERSION=5.1.2

.github/workflows/docker-build.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ jobs:
1010

1111
build-docker-images:
1212

13+
strategy:
14+
matrix:
15+
image-variant: [prd,dev]
16+
1317
runs-on: ubuntu-20.04
1418

1519
steps:
@@ -29,14 +33,14 @@ jobs:
2933
echo "docker-image-name=${DOCKER_IMAGE_NAME}" >> $GITHUB_OUTPUT
3034
echo "build-date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
3135
32-
- name: Fill Docker Image metadata
36+
- name: Fill "${{ steps.prep.outputs.docker-image-name }}" Docker Image metadata
3337
id: meta
3438
uses: docker/metadata-action@v4
3539
with:
3640
github-token: ${{ secrets.GITHUB_TOKEN }}
3741
images: "${{ steps.prep.outputs.docker-image-name }}"
3842
tags: |
39-
type=raw,value=rc
43+
type=raw,value=rc-${{ matrix.image-variant }}
4044
4145
- name: Set up Docker Buildx
4246
id: buildx
@@ -50,36 +54,30 @@ jobs:
5054
restore-keys: |
5155
${{ runner.os }}-buildx-
5256
53-
- name: Build Docker Image
57+
- name: Build "${{ steps.prep.outputs.docker-image-name }}" Docker Image
5458
id: build
5559
uses: docker/build-push-action@v3
5660
with:
5761
builder: ${{ steps.buildx.outputs.name }}
5862
context: .
5963
file: Dockerfile
64+
target: ${{ matrix.image-variant }}
6065
build-args: |
61-
VERSION_ARG=${{ env.ELASTICMS_ADMIN_VERSION }}
66+
VERSION_ARG=${{ env.ELASTICMS_CLI_VERSION }}
6267
RELEASE_ARG=${{ env.CI_RUN_ID }}
6368
VCS_REF_ARG=${{ env.CI_SHA }}
6469
BUILD_DATE_ARG=${{ steps.prep.outputs.build-date }}
6570
push: false
6671
load: true
6772
tags: ${{ steps.meta.outputs.tags }}
6873
labels: ${{ steps.meta.outputs.labels }}
69-
outputs: type=docker,dest=/tmp/myimage.tar
74+
outputs: type=docker,dest=/tmp/image.tar
7075

71-
- name: Squash Docker Image
72-
id: squash
76+
- name: Load Docker Image
7377
run: |
74-
pip install docker-squash
75-
cat /tmp/myimage.tar | docker load
76-
docker-squash --verbose --message "Build and Squashed in GitHub Action" \
77-
--tag ${{ steps.prep.outputs.docker-image-name }}:rc \
78-
--output-path /tmp/myimage.tar \
79-
${{ steps.prep.outputs.docker-image-name }}:rc
80-
cat /tmp/myimage.tar | docker load
78+
docker load --input /tmp/image.tar
8179
8280
- name: Check Docker Image
8381
run: |
84-
docker image inspect ${{ steps.prep.outputs.docker-image-name }}:rc
85-
docker history ${{ steps.prep.outputs.docker-image-name }}:rc
82+
docker image inspect ${{ steps.prep.outputs.docker-image-name }}:rc-${{ matrix.image-variant }}
83+
docker history ${{ steps.prep.outputs.docker-image-name }}:rc-${{ matrix.image-variant }}

0 commit comments

Comments
 (0)