Skip to content

Commit

Permalink
fix(CI): Fix buildx for 1.12.x branch (#301)
Browse files Browse the repository at this point in the history
* fix(CI): Fix buildx for 1.12.x branch

Signed-off-by: udit <[email protected]>
  • Loading branch information
uditgaurav authored Mar 4, 2021
1 parent ed38c30 commit b756c5c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Build
on:
pull_request:
branches: [master]
branches: [v1.12.x]
types: [opened, synchronize, reopened]

jobs:
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
env:
DOCKER_REPO: litmuschaos
DOCKER_IMAGE: go-runner
DOCKER_TAG: ci
DOCKER_TAG: 1.12.x-ci
run: |
cd go/src/github.com/${{github.repository}}
make build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Push
on:
push:
branches:
- master
- v1.12.x
tags-ignore:
- '**'

Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
env:
DOCKER_REPO: litmuschaos
DOCKER_IMAGE: go-runner
DOCKER_TAG: ci
DOCKER_TAG: 1.12.x-ci
run: |
cd go/src/github.com/${{github.repository}}
make experiment-build
Expand All @@ -79,7 +79,7 @@ jobs:
env:
DOCKER_REPO: litmuschaos
DOCKER_IMAGE: go-runner
DOCKER_TAG: ci
DOCKER_TAG: 1.12.x-ci
DNAME: ${{ secrets.DNAME }}
DPASS: ${{ secrets.DPASS }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ image-build:
@echo "-------------------------"
@echo "--> Build go-runner image"
@echo "-------------------------"
@sudo docker buildx build --file build/Dockerfile --progress plane --platform linux/arm64,linux/amd64 --no-cache --tag $(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG) .
@docker buildx build --file build/Dockerfile --progress plane --platform linux/arm64,linux/amd64 --no-cache --tag $(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG) .

.PHONY: build-amd64
build-amd64:
Expand Down
10 changes: 5 additions & 5 deletions build/push
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ then
exit 1
fi

IMAGEID=$( sudo docker images -q ${REPONAME}/${IMGNAME}:${IMGTAG} )
IMAGEID=$( docker images -q ${REPONAME}/${IMGNAME}:${IMGTAG} )

if [ ! -z "${DNAME}" ] && [ ! -z "${DPASS}" ];
then
sudo docker login -u "${DNAME}" -p "${DPASS}";
docker login -u "${DNAME}" -p "${DPASS}";
# Push image to docker hub
echo "Pushing ${REPONAME}/${IMGNAME}:${IMGTAG} ...";
sudo docker buildx build --file build/Dockerfile --push --progress plane --platform linux/arm64,linux/amd64 --no-cache --tag ${REPONAME}/${IMGNAME}:${IMGTAG} .
docker buildx build --file build/Dockerfile --push --progress plane --platform linux/arm64,linux/amd64 --no-cache --tag ${REPONAME}/${IMGNAME}:${IMGTAG} .
if [ ! -z "${RELEASE_TAG}" ] ;
then
# Push with different tags if tagged as a release
# When github is tagged with a release, then Travis will
# set the release tag in env RELEASE_TAG
echo "Pushing ${REPONAME}/${IMGNAME}:${RELEASE_TAG} ...";
sudo docker buildx build --file build/Dockerfile --push --progress plane --platform linux/arm64,linux/amd64 --no-cache --tag ${REPONAME}/${IMGNAME}:${RELEASE_TAG} .
docker buildx build --file build/Dockerfile --push --progress plane --platform linux/arm64,linux/amd64 --no-cache --tag ${REPONAME}/${IMGNAME}:${RELEASE_TAG} .
echo "Pushing ${REPONAME}/${IMGNAME}:latest ...";
sudo docker buildx build --file build/Dockerfile --push --progress plane --platform linux/arm64,linux/amd64 --no-cache --tag ${REPONAME}/${IMGNAME}:latest .
docker buildx build --file build/Dockerfile --push --progress plane --platform linux/arm64,linux/amd64 --no-cache --tag ${REPONAME}/${IMGNAME}:latest .
fi;
else
echo "No docker credentials provided. Skip uploading ${REPONAME}/${IMGNAME}:${IMGTAG} to docker hub";
Expand Down

0 comments on commit b756c5c

Please sign in to comment.