Skip to content

Commit

Permalink
Merge pull request #1073 from tu1h/fix_e2e_failure
Browse files Browse the repository at this point in the history
Remove building and uses of kubespray latest tag
  • Loading branch information
ErikJiang authored Jan 2, 2024
2 parents deb63d2 + f12dd30 commit 9620fc2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/auto-pr-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ env:
KUBESPRAY_IMAGE_NAME: kubespray
SPRAY_JOB_IMAGE_NAME: spray-job
AIRGAP_PATCH_IMAGE_NAME: airgap-patch
KUBESPRAY_TAG: latest

jobs:
get_ref:
Expand Down Expand Up @@ -90,19 +89,21 @@ jobs:
contents: read

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ needs.get_ref.outputs.ref }}

- name: Set env
run: |
ORGANIZATION_NAME=$(echo ${GITHUB_REPOSITORY}| awk -F "/" '{print $1}')
echo "REPO=${ORGANIZATION_NAME,,}" >> ${GITHUB_ENV}
echo "KUBESPRAY_TAG=$(git tag | tail -1)" >> ${GITHUB_ENV}
- name: Echo env
run: |
echo "REPO: ${{ env.REPO }}"
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ needs.get_ref.outputs.ref }}
echo "KUBESPRAY_TAG: ${{ env.KUBESPRAY_TAG }}"
- name: Log in to registry
# This is where you will update the PAT to GITHUB_TOKEN
Expand Down Expand Up @@ -139,7 +140,7 @@ jobs:
docker push $IMAGE_ID:$VERSION
- name: spray-job Build image
run: docker build . --file ./build/images/$SPRAY_JOB_IMAGE_NAME/Dockerfile --tag $SPRAY_JOB_IMAGE_NAME --build-arg SPRAY_TAG=$KUBESPRAY_TAG
run: docker build . --file ./build/images/$SPRAY_JOB_IMAGE_NAME/Dockerfile --tag $SPRAY_JOB_IMAGE_NAME --build-arg SPRAY_TAG=${{ env.KUBESPRAY_TAG }}

- name: spray-job Push image
run: |
Expand All @@ -154,7 +155,7 @@ jobs:
docker push $IMAGE_ID:$VERSION
- name: airgap-patch Build image
run: docker build . --file ./build/images/$AIRGAP_PATCH_IMAGE_NAME/Dockerfile --tag $AIRGAP_PATCH_IMAGE_NAME --build-arg SPRAY_TAG=$KUBESPRAY_TAG
run: docker build . --file ./build/images/$AIRGAP_PATCH_IMAGE_NAME/Dockerfile --tag $AIRGAP_PATCH_IMAGE_NAME --build-arg SPRAY_TAG=${{ env.KUBESPRAY_TAG }}

- name: airgap-patch Push image
run: |
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/build-push-for-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ env:
KUBESPRAY_IMAGE_NAME: kubespray
SPRAY_JOB_IMAGE_NAME: spray-job
AIRGAP_PATCH_IMAGE_NAME: airgap-patch
KUBESPRAY_TAG: latest

jobs:
build-push-for-e2e:
Expand All @@ -19,19 +18,21 @@ jobs:
contents: read

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ needs.get_ref.outputs.ref }}

- name: Set env
run: |
ORGANIZATION_NAME=$(echo ${GITHUB_REPOSITORY}| awk -F "/" '{print $1}')
echo "REPO=${ORGANIZATION_NAME,,}" >> ${GITHUB_ENV}
echo "KUBESPRAY_TAG=$(git tag | tail -1)" >> ${GITHUB_ENV}
- name: Echo env
run: |
echo "REPO: ${{ env.REPO }}"
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ needs.get_ref.outputs.ref }}
echo "KUBESPRAY_TAG: ${{ env.KUBESPRAY_TAG }}"
- name: Log in to registry
# This is where you will update the PAT to GITHUB_TOKEN
Expand Down Expand Up @@ -68,7 +69,7 @@ jobs:
docker push $IMAGE_ID:$VERSION
- name: spray-job Build image
run: docker build . --file ./build/images/$SPRAY_JOB_IMAGE_NAME/Dockerfile --tag $SPRAY_JOB_IMAGE_NAME --build-arg SPRAY_TAG=$KUBESPRAY_TAG
run: docker build . --file ./build/images/$SPRAY_JOB_IMAGE_NAME/Dockerfile --tag $SPRAY_JOB_IMAGE_NAME --build-arg SPRAY_TAG=${{ env.KUBESPRAY_TAG }}

- name: spray-job Push image
run: |
Expand All @@ -83,7 +84,7 @@ jobs:
docker push $IMAGE_ID:$VERSION
- name: airgap-patch Build image
run: docker build . --file ./build/images/$AIRGAP_PATCH_IMAGE_NAME/Dockerfile --tag $AIRGAP_PATCH_IMAGE_NAME --build-arg SPRAY_TAG=$KUBESPRAY_TAG
run: docker build . --file ./build/images/$AIRGAP_PATCH_IMAGE_NAME/Dockerfile --tag $AIRGAP_PATCH_IMAGE_NAME --build-arg SPRAY_TAG=${{ env.KUBESPRAY_TAG }}

- name: airgap-patch Push image
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/call-build-imgs-for-spray.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,5 @@ jobs:
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ inputs.REPO }}/kubespray:${{ needs.output-variable.outputs.image_tag_short_sha }}
ghcr.io/${{ inputs.REPO }}/kubespray:latest
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 9620fc2

Please sign in to comment.