-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(dockerfiles/cd): split image from ci dir to cd/utils
and add `manifest-tool` in the release util image Signed-off-by: wuhuizuo <wuhuizuo@126.com>
- Loading branch information
Showing
9 changed files
with
191 additions
and
78 deletions.
There are no files selected for viewing
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,65 @@ | ||
name: Pull test for CD utils images | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "dockerfiles/cd/utils/**/Dockerfile" | ||
- "dockerfiles/cd/utils/**/*.Dockerfile" | ||
- "dockerfiles/cd/utils/skaffold.yaml" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
skaffold: | ||
name: build images with skaffold | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
strategy: | ||
max-parallel: 1 | ||
matrix: | ||
module: [utils] | ||
builder-profile: [local-docker] | ||
platform: [linux/amd64, linux/arm64] | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
# https://github.com/docker/setup-qemu-action | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
# https://github.com/docker/setup-buildx-action | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup skaffold | ||
run: | | ||
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.8.0/skaffold-linux-amd64 && \ | ||
sudo install skaffold /usr/local/bin/ | ||
- name: Build images | ||
working-directory: dockerfiles/cd/utils | ||
run: | | ||
skaffold build \ | ||
--build-concurrency 1 \ | ||
--cache-artifacts \ | ||
--default-repo ghcr.io/pingcap-qe/cd/utils \ | ||
--module ${{ matrix.module }} \ | ||
--platform ${{ matrix.platform }} \ | ||
--profile ${{ matrix.builder-profile }} \ | ||
--push=false |
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
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,59 @@ | ||
name: Publish CD utils images | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "dockerfiles/cd/utils/**/Dockerfile" | ||
- "dockerfiles/cd/utils/**/*.Dockerfile" | ||
- "dockerfiles/cd/utils/skaffold.yaml" | ||
|
||
jobs: | ||
skaffold: | ||
name: publish images with skaffold | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
strategy: | ||
max-parallel: 1 | ||
matrix: | ||
module: [utils] | ||
builder-profile: [local-docker] | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
# https://github.com/docker/setup-qemu-action | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
# https://github.com/docker/setup-buildx-action | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup skaffold | ||
run: | | ||
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.8.0/skaffold-linux-amd64 && \ | ||
sudo install skaffold /usr/local/bin/ | ||
- name: Publish images | ||
working-directory: dockerfiles/cd/utils | ||
run: | | ||
skaffold build \ | ||
--build-concurrency 1 \ | ||
--cache-artifacts \ | ||
--default-repo ghcr.io/pingcap-qe/cd/utils \ | ||
--module ${{ matrix.module }} \ | ||
--profile ${{ matrix.builder-profile }} |
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
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,19 @@ | ||
FROM golang:1.21.4-alpine3.18 as gomplate_builder | ||
|
||
RUN wget https://github.com/hairyhenderson/gomplate/archive/refs/heads/main.zip -O - | unzip - && cd gomplate-main && go build -o /usr/local/bin/gomplate ./cmd/gomplate | ||
|
||
FROM alpine:3.18.4 | ||
|
||
LABEL org.opencontainers.image.authors "wuhui.zuo@pingcap.com" | ||
LABEL org.opencontainers.image.description "utils image for CD release" | ||
|
||
# install tools: bash, git, jq, yq, goemplate | ||
# RUN apk add --no-cache bash git jq yq gomplate | ||
RUN apk add --no-cache bash git jq yq | ||
COPY --from=gomplate_builder /usr/bin/gomplate /usr/local/bin/gomplate | ||
|
||
# install tools: oras | ||
COPY --from=ghcr.io/oras-project/oras:v1.1.0 /bin/oras /usr/local/bin/oras | ||
|
||
# install tools: manifest-tool | ||
COPY --from=mplatform/manifest-tool:alpine-v2.1.3 /manifest-tool /usr/local/bin/manifest-tool |
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,44 @@ | ||
--- | ||
apiVersion: skaffold/v4beta6 | ||
kind: Config | ||
metadata: | ||
name: utils | ||
build: | ||
artifacts: | ||
- image: release | ||
platforms: [linux/amd64, linux/arm64] | ||
kaniko: | ||
dockerfile: utils/release/Dockerfile | ||
cache: {} | ||
tagPolicy: | ||
customTemplate: | ||
template: "{{ .SHA }}" | ||
components: | ||
- name: SHA | ||
gitCommit: | ||
variant: AbbrevCommitSha | ||
cluster: | ||
concurrency: 0 | ||
randomDockerConfigSecret: false | ||
randomPullSecret: false | ||
dockerConfig: | ||
secretName: hub-pingcap-net-ee | ||
resources: | ||
requests: | ||
cpu: "1" | ||
memory: 2Gi | ||
limits: | ||
cpu: "2" | ||
memory: 4Gi | ||
profiles: | ||
- name: local-docker | ||
build: | ||
local: | ||
useDockerCLI: true | ||
useBuildkit: true | ||
concurrency: 0 | ||
tryImportMissing: true | ||
patches: | ||
- op: move | ||
from: /build/artifacts/0/kaniko | ||
path: /build/artifacts/0/docker |
This file was deleted.
Oops, something went wrong.
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