Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync branch release-1.27 #25

Merged
merged 6 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Prepare
id: prepare
Expand All @@ -38,14 +38,26 @@ jobs:
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Docker login
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
- name: Login to Aliyun
uses: docker/login-action@v3
with:
registry: registry.cn-beijing.aliyuncs.com
username: ${{ secrets.ALIYUNCS_USERNAME }}
password: ${{ secrets.ALIYUNCS_PASSWORD }}

- name: Login to Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker images
uses: docker/build-push-action@v3
with:
tags: |
kubesphere/kubectl:${{ steps.prepare.outputs.version }}
registry.cn-beijing.aliyuncs.com/kubesphereio/kubectl:${{ steps.prepare.outputs.version }}
push: true
platforms: linux/amd64,linux/arm64

- name: Run buildx
run: |
docker buildx build --platform linux/amd64,linux/arm64 --push --file ./Dockerfile -t kubesphere/kubectl:${{ steps.prepare.outputs.version }} .

10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine:3.18.2
FROM alpine:3.18.8

ARG KUBECTL_VERSION=v1.27.12
ARG HELM_VERSION=v3.12.3
ARG KUBECTL_VERSION=v1.27.16
ARG HELM_VERSION=v3.14.1
ARG KUSTOMIZE_VERSION=v5.1.0
ARG TARGETOS
ARG TARGETARCH
Expand All @@ -14,6 +14,7 @@ RUN apk update && apk add \
vim \
curl \
jq \
yq \
grep \
wget \
tcpdump \
Expand All @@ -26,8 +27,7 @@ RUN apk update && apk add \
mv /usr/local/bin/${TARGETOS}-${TARGETARCH}/helm /usr/local/bin && \
rm helm-${HELM_VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz && \
rm -rf /usr/local/bin/${TARGETOS}-${TARGETARCH} && \
helm plugin install https://github.com/helm/helm-mapkubeapis && \
apk del git
helm plugin install https://github.com/helm/helm-mapkubeapis

RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/${TARGETOS}/${TARGETARCH}/kubectl && \
chmod +x ./kubectl && \
Expand Down
Loading