Skip to content

Commit

Permalink
Correct Output Options
Browse files Browse the repository at this point in the history
And add better comments
  • Loading branch information
biodrone committed Dec 20, 2019
1 parent 3b1ce84 commit b3be084
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
9 changes: 5 additions & 4 deletions travis/build-amd64.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/bash
set -ev

# Set Build Options
PLATFORM=amd64
DOCKERFILE_LOCATION="./docker/Dockerfile.amd64"
DOCKER_IMAGE="go-auto-yt"
DOCKER_TAG="stable"

# If This Isn't A PR, Push to Dockerhub
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD

Expand All @@ -14,12 +16,11 @@ if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
--opt platform=linux/${PLATFORM} \
--opt filename=${DOCKERFILE_LOCATION} \
--opt build-arg:TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST} \
--output type=image \
--output name=docker.io/${DOCKER_USER}/${DOCKER_IMAGE}:${DOCKER_TAG}-${PLATFORM} \
--output push=true \
--output type=image,name=docker.io/${DOCKER_USER}/${DOCKER_IMAGE}:${DOCKER_TAG}-${PLATFORM},push=true \
--local dockerfile=. \
--local context=.
else
# If This is a PR, Build to Check for Errors
buildctl build --frontend dockerfile.v0 \
--progress=plain \
--opt platform=linux/${PLATFORM} \
Expand All @@ -29,4 +30,4 @@ else
--local dockerfile=. \
--local context=. \
| docker load
fi
fi
6 changes: 4 additions & 2 deletions travis/build-arm.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/bash
set -ev

# Set Build Options
PLATFORM=arm
DOCKERFILE_LOCATION="./docker/Dockerfile.arm"
DOCKER_IMAGE="go-auto-yt"
DOCKER_TAG="stable"

# If This Isn't A PR, Push to Dockerhub
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD

Expand All @@ -14,11 +16,11 @@ if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
--opt platform=linux/${PLATFORM} \
--opt filename=${DOCKERFILE_LOCATION} \
--opt build-arg:TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST} \
--output type=image,name=docker.io/${DOCKER_USERNAME}/${IMAGE}:${TAG}-${PLATFORM} \
--output push=true \
--output type=image,name=docker.io/${DOCKER_USER}/${DOCKER_IMAGE}:${DOCKER_TAG}-${PLATFORM},push=true \
--local dockerfile=. \
--local context=.
else
# If This is a PR, Build to Check for Errors
buildctl build --frontend dockerfile.v0 \
--progress=plain \
--opt platform=linux/${PLATFORM} \
Expand Down
9 changes: 5 additions & 4 deletions travis/build-arm64.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/bash
set -ev

# Set Build Options
PLATFORM=arm64
DOCKERFILE_LOCATION="./docker/Dockerfile.arm64"
DOCKER_IMAGE="go-auto-yt"
DOCKER_TAG="stable"

# If This Isn't A PR, Push to Dockerhub
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD

Expand All @@ -14,12 +16,11 @@ if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
--opt platform=linux/${PLATFORM} \
--opt filename=${DOCKERFILE_LOCATION} \
--opt build-arg:TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST} \
--output type=image \
--output name=docker.io/${DOCKER_USER}/${IMAGE}:${TAG}-${PLATFORM} \
--output push=true \
--output type=image,name=docker.io/${DOCKER_USER}/${DOCKER_IMAGE}:${DOCKER_TAG}-${PLATFORM},push=true \
--local dockerfile=. \
--local context=.
else
# If This is a PR, Build to Check for Errors
buildctl build --frontend dockerfile.v0 \
--progress=plain \
--opt platform=linux/${PLATFORM} \
Expand All @@ -29,4 +30,4 @@ else
--local dockerfile=. \
--local context=. \
| docker load
fi
fi

0 comments on commit b3be084

Please sign in to comment.