Skip to content

chore: configuration updated by Administrator for e2 staging environment #10

chore: configuration updated by Administrator for e2 staging environment

chore: configuration updated by Administrator for e2 staging environment #10

Workflow file for this run

name: Process Edge Device Releases
on:
push:
paths:
- 'e2/release.yaml'
jobs:
handle-edge-device-releases:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Pull, tag, and push images
run: |
# Parse the release.yaml file to extract versions
yq e '... comments=""' e2/release.yaml > temp.yaml
ENVS=$(yq e '.application.envs' temp.yaml)
echo "Recap step: attempting to process the following releases:"
echo "$ENVS" | while IFS=: read -r env version; do
version=${version//[[:space:]]/} # Trim whitespace from version
IMAGE="aixpand/exe_eng:$version"
NEW_TAG="aixpand/exe_eng:$env"
echo "Environment: $env <- Version: $version"
done
echo "Processing step:"
echo "$ENVS" | while IFS=: read -r env version; do
version=${version//[[:space:]]/}
IMAGE="aixpand/exe_eng:$version"
NEW_TAG="aixpand/exe_eng:$env"
# Pull the specified version
echo "Pulling $IMAGE..."
if ! docker pull $IMAGE; then
echo "Failed to pull image $IMAGE"
exit 1
fi
# Tag and push the image with the environment tag
echo "Tagging $IMAGE as $NEW_TAG..."
docker tag $IMAGE $NEW_TAG
echo "Pushing $NEW_TAG..."
docker push $NEW_TAG
done
shell: bash
- name: Logout from Docker Hub
run: docker logout