Skip to content

Commit

Permalink
Update e2e common debug script WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Feb 8, 2024
1 parent d85dced commit 2d92a47
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions .github/workflows/e2e-common-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
runs-on: [self-hosted, v3]
outputs:
image: ${{ steps.export.outputs.IMAGE }}
promoted_image: ${{ steps.export.outputs.PROMOTED_IMAGE }}
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down Expand Up @@ -59,11 +58,9 @@ jobs:
echo "Export $CIUX_IMAGE_URL to archive"
docker save "$CIUX_IMAGE_URL" > artifacts/image.tar
fi
echo "PROMOTED_IMAGE=''" >> "$GITHUB_OUTPUT"
else
echo "Using existing image $CIUX_IMAGE_URL"
touch artifacts/empty
echo "PROMOTED_IMAGE=$CIUX_IMAGE_REGISTRY/$CIUX_IMAGE_NAME/$FINKCTL_VERSION" >> "$GITHUB_OUTPUT"
fi
echo "IMAGE=$CIUX_IMAGE_URL" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v2
Expand All @@ -73,6 +70,9 @@ jobs:
integration-tests:
name: Run integration tests
runs-on: [self-hosted, v3]
outputs:
new_image: ${{ steps.promote.outputs.NEW_IMAGE }}
promoted_image: ${{ steps.promote.outputs.PROMOTED_IMAGE }}
needs: build
steps:
- name: Checkout code
Expand Down Expand Up @@ -134,6 +134,12 @@ jobs:
- name: Check results
run: |
./e2e/check-results.sh
- name: Promote fink-broker image
id: promote
run: |
. "$CIUXCONFIG"
echo "PROMOTED_IMAGE=$CIUX_IMAGE_REGISTRY/$CIUX_IMAGE_NAME/$FINKCTL_VERSION" >> "$GITHUB_OUTPUT"
echo "NEW_IMAGE=$CIUX_BUILD" >> "$GITHUB_OUTPUT"
image-analysis:
name: Analyze image
runs-on: [self-hosted, v3]
Expand Down Expand Up @@ -193,17 +199,20 @@ jobs:
registry: gitlab-registry.in2p3.fr
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Push image to IN2P3 registry
- name: Push image to official registry
run: |
IMAGE="${{ needs.build.outputs.image }}"
PROMOTED_IMAGE="${{ needs.build.outputs.promoted_image }}"
if [ -n "$PROMOTED_IMAGE" ]; then
sudo apt-get install -y skopeo
echo "Adding image tag $PROMOTED_IMAGE to $IMAGE"
skopeo copy docker://$IMAGE docker://$PROMOTED_IMAGE
else
NEW_IMAGE="${{ needs.integration-tests.outputs.new_image }}"
PROMOTED_IMAGE="${{ needs.integration-tests.outputs.promoted_image }}"
if [ $NEW_IMAGE = true ]; then
echo "Push image $IMAGE"
docker tag "$IMAGE" "$PROMOTED_IMAGE"
docker push "${{ needs.build.outputs.image }}"
else
sudo apt-get update -y
sudo apt-get install -y skopeo
echo "Add image tag $PROMOTED_IMAGE to $IMAGE"
skopeo copy docker://$IMAGE docker://$PROMOTED_IMAGE
fi

0 comments on commit 2d92a47

Please sign in to comment.