Skip to content

Commit

Permalink
Merge pull request #209 from edx/usamasadiq/update-dockerhub-credentials
Browse files Browse the repository at this point in the history
Use GitHub credentials for docker-publish CI check
  • Loading branch information
UsamaSadiq authored Oct 6, 2021
2 parents 73ad1fa + e308777 commit f7593be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
env:
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
run : make travis_docker_push
run : make docker_push
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/make -f

.PHONY: clean help quality requirements selfcheck test test-all upgrade validate
.PHONY: docker_build travis_docker_auth travis_docker_tag travis_docker_push
.PHONY: docker_build docker_auth docker_tag docker_push
.DEFAULT_GOAL := help

define BROWSER_PYSCRIPT
Expand All @@ -26,7 +26,7 @@ var:
mkdir var || true

$(SQLITE_DB): var
# The --noinput flag is for non-interactive runs, e.g. TravisCI.
# The --noinput flag is for non-interactive runs, e.g. GitHub CI.
python3 manage.py migrate --noinput

clean: ## remove generated byte code, coverage reports, and build artifacts
Expand Down Expand Up @@ -113,14 +113,14 @@ dev.stop: # Stops containers so they can be restarted
app-shell: # Run bash in the container as root
docker exec -u 0 -it edx.devstack.xblock-sdk bash

travis_docker_auth:
echo "$$DOCKER_PASSWORD" | docker login -u "$$DOCKER_USERNAME" --password-stdin
docker_auth:
echo "$$DOCKERHUB_PASSWORD" | docker login -u "$$DOCKERHUB_USERNAME" --password-stdin

travis_docker_tag: docker_build
docker tag "openedx/xblock-sdk:latest" "openedx/xblock-sdk:$$TRAVIS_COMMIT"
docker_tag: docker_build
docker tag "openedx/xblock-sdk:latest" "openedx/xblock-sdk:${GITHUB_SHA}"

travis_docker_push: | travis_docker_auth travis_docker_tag ## push to docker hub
echo "$$TRAVIS_COMMIT"
docker_push: | docker_auth docker_tag ## push to docker hub
echo "${GITHUB_SHA}"
docker images
docker -l debug push "openedx/xblock-sdk:latest"
docker -l debug push "openedx/xblock-sdk:$$TRAVIS_COMMIT"
docker -l debug push "openedx/xblock-sdk:${GITHUB_SHA}"

0 comments on commit f7593be

Please sign in to comment.