Skip to content

Dev Build

Dev Build #11

Workflow file for this run

# Copyright 2022 Greptime Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: GreptimeDB Operator Development Build
on:
workflow_dispatch: # Allows you to run this workflow manually.
inputs:
repository:
description: The public repository to build
required: false
default: GreptimeTeam/greptimedb-operator
commit: # Note: We only pull the source code and use the current workflow to build the artifacts.
description: The commit to build
required: true
env:
GO_VERSION: "1.21"
# The source code will check out in the following path: '${WORKING_DIR}/dev/greptimedb-operator'.
CHECKOUT_SOURCE_PATH: dev/greptimedb-operator
jobs:
docker:
name: build-images
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout greptimedb-operator
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.commit }}
path: ${{ env.CHECKOUT_SOURCE_PATH }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.ECR_REGION }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
- name: Login to AliCloud Container Registry
uses: docker/login-action@v3
with:
registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com
username: ${{ secrets.ALICLOUD_USERNAME }}
password: ${{ secrets.ALICLOUD_PASSWORD }}
- name: Configure tag
shell: bash
run: |
VERSION="dev-$(date "+%Y%m%d-%s")-$(echo "${{ inputs.commit }}" | cut -c1-8)"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Build and push operator
uses: docker/build-push-action@v5
with:
context: ${{ env.CHECKOUT_SOURCE_PATH }}
file: ./docker/operator/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
greptime/greptimedb-operator-dev:latest
greptime/greptimedb-operator-dev:${{ env.VERSION }}
greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-operator-dev:latest
greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-operator-dev:${{ env.VERSION }}
${{ vars.ECR_REGISTRY }}/greptime/greptimedb-operator-dev:latest
${{ vars.ECR_REGISTRY }}/greptime/greptimedb-operator-dev:${{ env.VERSION }}
- name: Build and push initializer
uses: docker/build-push-action@v5
with:
context: ${{ env.CHECKOUT_SOURCE_PATH }}
file: ./docker/initializer/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
greptime/greptimedb-initializer-dev:latest
greptime/greptimedb-initializer-dev:${{ env.VERSION }}
greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-initializer-dev:latest
greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-initializer-dev:${{ env.VERSION }}
${{ vars.ECR_REGISTRY }}/greptime/greptimedb-initializer-dev:latest
${{ vars.ECR_REGISTRY }}/greptime/greptimedb-initializer-dev:${{ env.VERSION }}