Skip to content

Commit

Permalink
Use different docker.env per architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Ledez committed Oct 6, 2023
1 parent d996d95 commit c9028b5
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,18 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
- name: Test docker amd64 image
run: |
export CONTAINER_NAME=cgwire-amd64
export CONTAINER_ARCH=arm64
export CONTAINER_NAME=cgwire-${CONTAINER_ARCH}
export LOCAL_PORT=8001
echo "KITSU_VERSION=${{ steps.versions.outputs.KITSU_VERSION }}" >> docker.env
echo "ZOU_VERSION=${{ steps.versions.outputs.ZOU_VERSION }}" >> docker.env
> docker-${CONTAINER_ARCH}.env
echo "KITSU_VERSION=${{ steps.versions.outputs.KITSU_VERSION }}" >> docker-${CONTAINER_ARCH}.env
echo "ZOU_VERSION=${{ steps.versions.outputs.ZOU_VERSION }}" >> docker-${CONTAINER_ARCH}.env
docker container run --platform=linux/amd64 -d --init -p ${LOCAL_PORT}:80 --rm --name ${CONTAINER_NAME} cgwire/cgwire:latest
echo "KITSU_URL=http://$(docker inspect ${CONTAINER_NAME} | jq -r '.[0]["NetworkSettings"]["IPAddress"]')" >> docker.env
echo "KITSU_URL=http://$(docker inspect ${CONTAINER_NAME} | jq -r '.[0]["NetworkSettings"]["IPAddress"]')" >> docker-${CONTAINER_ARCH}.env
sleep 10
docker container run --env-file docker.env cgwire/kitsu-checker:latest
docker container run --env-file docker-${CONTAINER_ARCH}.env cgwire/kitsu-checker:latest
docker kill ${CONTAINER_NAME}
# arm64
Expand All @@ -81,16 +83,18 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
- name: Test docker arm64 image
run: |
export CONTAINER_NAME=cgwire-arm64
export CONTAINER_ARCH=arm64
export CONTAINER_NAME=cgwire-${CONTAINER_ARCH}
export LOCAL_PORT=8002
echo "KITSU_VERSION=${{ steps.versions.outputs.KITSU_VERSION }}" >> docker.env
echo "ZOU_VERSION=${{ steps.versions.outputs.ZOU_VERSION }}" >> docker.env
> docker-${CONTAINER_ARCH}.env
echo "KITSU_VERSION=${{ steps.versions.outputs.KITSU_VERSION }}" >> docker-${CONTAINER_ARCH}.env
echo "ZOU_VERSION=${{ steps.versions.outputs.ZOU_VERSION }}" >> docker-${CONTAINER_ARCH}.env
docker container run --platform=linux/arm64 -d --init -p ${LOCAL_PORT}:80 --rm --name ${CONTAINER_NAME} cgwire/cgwire:latest
echo "KITSU_URL=http://$(docker inspect ${CONTAINER_NAME} | jq -r '.[0]["NetworkSettings"]["IPAddress"]')" >> docker.env
echo "KITSU_URL=http://$(docker inspect ${CONTAINER_NAME} | jq -r '.[0]["NetworkSettings"]["IPAddress"]')" >> docker-${CONTAINER_ARCH}.env
sleep 30
docker container run --env-file docker.env cgwire/kitsu-checker:latest
docker container run --env-file docker-${CONTAINER_ARCH}.env cgwire/kitsu-checker:latest
docker kill ${CONTAINER_NAME}
- name: Push Docker image
Expand Down

0 comments on commit c9028b5

Please sign in to comment.