-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add more options for releasing dev-builder images (#2573)
- Loading branch information
Showing
3 changed files
with
121 additions
and
106 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: Build and push dev-builder images | ||
description: Build and push dev-builder images to DockerHub and ACR | ||
inputs: | ||
dockerhub-image-registry: | ||
description: The dockerhub image registry to store the images | ||
required: false | ||
default: docker.io | ||
dockerhub-image-registry-username: | ||
description: The dockerhub username to login to the image registry | ||
required: true | ||
dockerhub-image-registry-token: | ||
description: The dockerhub token to login to the image registry | ||
required: true | ||
dockerhub-image-namespace: | ||
description: The dockerhub namespace of the image registry to store the images | ||
required: false | ||
default: greptime | ||
acr-image-registry: | ||
description: The ACR image registry to store the images | ||
required: true | ||
acr-image-registry-username: | ||
description: The ACR username to login to the image registry | ||
required: true | ||
acr-image-registry-password: | ||
description: The ACR password to login to the image registry | ||
required: true | ||
acr-image-namespace: | ||
description: The ACR namespace of the image registry to store the images | ||
required: false | ||
default: greptime | ||
version: | ||
description: Version of the dev-builder | ||
required: false | ||
default: latest | ||
build-dev-builder-ubuntu: | ||
describtion: Build dev-builder-ubuntu image | ||
required: false | ||
default: 'true' | ||
build-dev-builder-centos: | ||
describtion: Build dev-builder-centos image | ||
required: false | ||
default: 'true' | ||
build-dev-builder-android: | ||
describtion: Build dev-builder-android image | ||
required: false | ||
default: 'true' | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Install skopeo | ||
shell: bash | ||
run: | | ||
sudo apt update && sudo apt install -y skopeo | ||
- name: Login to Dockerhub | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ inputs.dockerhub-image-registry }} | ||
username: ${{ inputs.dockerhub-image-registry-username }} | ||
password: ${{ inputs.dockerhub-image-registry-token }} | ||
|
||
- name: Build and push dev-builder-ubuntu image | ||
shell: bash | ||
if: ${{ inputs.build-dev-builder-ubuntu == 'true' }} | ||
run: | ||
make dev-builder \ | ||
BASE_IMAGE=ubuntu \ | ||
BUILDX_MULTI_PLATFORM_BUILD=true \ | ||
IMAGE_REGISTRY=${{ inputs.dockerhub-image-registry }} \ | ||
IMAGE_NAMESPACE=${{ inputs.dockerhub-image-namespace }} \ | ||
IMAGE_TAG=${{ inputs.version }} && \ | ||
|
||
skopeo copy -a docker://docker.io/${{ inputs.dockerhub-image-namespace }}/dev-builder-ubuntu:${{ inputs.version }} \ | ||
--dest-creds "${{ inputs.acr-image-registry-username }}":"${{ inputs.acr-image-registry-password }}" \ | ||
docker://${{ inputs.acr-image-registry }}/${{ inputs.acr-image-namespace }}/dev-builder-ubuntu:${{ inputs.version }} | ||
|
||
- name: Build and push dev-builder-centos image | ||
shell: bash | ||
if: ${{ inputs.build-dev-builder-centos == 'true' }} | ||
run: | ||
make dev-builder \ | ||
BASE_IMAGE=centos \ | ||
BUILDX_MULTI_PLATFORM_BUILD=true \ | ||
IMAGE_REGISTRY=${{ inputs.dockerhub-image-registry }} \ | ||
IMAGE_NAMESPACE=${{ inputs.dockerhub-image-namespace }} \ | ||
IMAGE_TAG=${{ inputs.version }} && \ | ||
|
||
skopeo copy -a docker://docker.io/${{ inputs.dockerhub-image-namespace }}/dev-builder-centos:${{ inputs.version }} \ | ||
--dest-creds "${{ inputs.acr-image-registry-username }}":"${{ inputs.acr-image-registry-password }}" \ | ||
docker://${{ inputs.acr-image-registry }}/${{ inputs.acr-image-namespace }}/dev-builder-centos:${{ inputs.version }} | ||
|
||
- name: Build and push dev-builder-android image # Only build amd64 platform. | ||
shell: bash | ||
if: ${{ inputs.build-dev-builder-android == 'true' }} | ||
run: | ||
make dev-builder \ | ||
BASE_IMAGE=android \ | ||
IMAGE_REGISTRY=${{ inputs.dockerhub-image-registry }} \ | ||
IMAGE_NAMESPACE=${{ inputs.dockerhub-image-namespace }} \ | ||
IMAGE_TAG=${{ inputs.version }} && \ | ||
|
||
skopeo copy -a docker://docker.io/${{ inputs.dockerhub-image-namespace }}/dev-builder-android:${{ inputs.version }} \ | ||
--dest-creds "${{ inputs.acr-image-registry-username }}":"${{ inputs.acr-image-registry-password }}" \ | ||
docker://${{ inputs.acr-image-registry }}/${{ inputs.acr-image-namespace }}/dev-builder-android:${{ inputs.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters