Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GitHub credentials for docker-publish CI check #209

Merged
merged 1 commit into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}"