Commit 8431b341 authored by Peter Parente's avatar Peter Parente

Push images, git changes

parent d2cb8057
......@@ -12,6 +12,7 @@ jobs:
build:
name: Build Docker Images
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message , 'ci skip')"
steps:
- name: Clone Main Repo
uses: actions/checkout@v2
......@@ -47,12 +48,15 @@ jobs:
- build
if: github.ref == 'refs/heads/master'
steps:
# TODO: need to auth with docker hub
- name: Push Images
- name: Login to Docker Hub
run: >
echo '${{secrets.DOCKERHUB_PASSWORD}}' | docker login --username
'${{secrets.DOCKERHUB_USERNAME}}'' --password-stdin
- name: Push Images to DockerHub
run: make -C main push-all
# TODO: doesn't support working directory
- name: Push Wiki
uses: mikeal/publish-to-github-action@master
- name: Push Wiki to GitHub
run: make -C main git-commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{github.repository}}.wiki
LOCAL_PATH: ../wiki
......@@ -10,6 +10,7 @@ jobs:
build:
name: Build Sphinx Documentation
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message , 'ci skip')"
steps:
- name: Checkout Repo
uses: actions/checkout@v2
......@@ -29,15 +30,16 @@ jobs:
runs-on: ubuntu-latest
needs:
- build
if: github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, 'ci skip')
if: github.ref == 'refs/heads/master'
steps:
- name: Extract Source Strings
working-directory: docs
run: |
make gettext
sphinx-intl update -p _build/gettext -l en
# TODO: need to ci skip to prevent looping
- name: Push Strings to Master
uses: mikeal/publish-to-github-action@master
run: make git-commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
LOCAL_PATH: ./docs/locale/en
......@@ -4,9 +4,8 @@
# Use bash for inline if-statements in arch_patch target
SHELL:=bash
OWNER:=jupyter
ARCH:=$(shell uname -m)
DIFF_RANGE?=master...HEAD
OWNER?=jupyter
# Need to list the images in build dependency order
ifeq ($(ARCH),ppc64le)
......@@ -76,9 +75,26 @@ dev/%: ## run a foreground container for a stack
dev-env: ## install libraries required to build docs and run tests
pip install -r requirements-dev.txt
docs: ## build HTML documentation
make -C docs html
git-commit: LOCAL_PATH?=.
git-commit: export GITHUB_SHA?=$(shell git rev-parse HEAD)
git-commit: GITHUB_REPOSITORY?=jupyter/docker-stacks
git-commit: ## commit outstading git changes and push to remote
@git config --global user.name "GitHub Actions"
@git config --global user.email "actions@users.noreply.github.com"
@git remote add publisher https://$${GITHUB_TOKEN}@github.com/$${GITHUB_REPOSITORY}.git
@cd $(LOCAL_PATH)
@git checkout master
@git add -A -- .
@git commit -m "[ci skip] Automated publish for $${GITHUB_SHA}" || exit 0
@git push -u publisher master
hook/%: export COMMIT_MSG?=$(shell git log -1 --pretty=%B)
hook/%: export GITHUB_SHA?=$(shell git rev-parse HEAD)
hook/%: export WIKI_PATH?=./wiki
hook/%: export WIKI_PATH?=../wiki
hook/%: ## run post-build hooks for an image
BUILD_TIMESTAMP="$$(date -u +%FT%TZ)" \
DOCKER_REPO="$(OWNER)/$(notdir $@)" \
......@@ -88,23 +104,6 @@ hook/%: ## run post-build hooks for an image
hook-all: $(foreach I,$(ALL_IMAGES),hook/$(I) ) ## run post-build hooks for all images
lint/%: ARGS?=
lint/%: ## lint the dockerfile(s) for a stack
@echo "Linting Dockerfiles in $(notdir $@)..."
@git ls-files --exclude='Dockerfile*' --ignored $(notdir $@) | grep -v ppc64 | xargs -L 1 $(HADOLINT) $(ARGS)
@echo "Linting done!"
lint-all: $(foreach I,$(ALL_IMAGES),lint/$(I) ) ## lint all stacks
lint-build-test-all: $(foreach I,$(ALL_IMAGES),lint/$(I) arch_patch/$(I) build/$(I) test/$(I) ) ## lint, build and test all stacks
lint-install: ## install hadolint
@echo "Installing hadolint at $(HADOLINT) ..."
@curl -sL -o $(HADOLINT) "https://github.com/hadolint/hadolint/releases/download/v1.18.0/hadolint-$(shell uname -s)-$(shell uname -m)"
@chmod 700 $(HADOLINT)
@echo "Installation done!"
@$(HADOLINT) --version
img-clean: img-rm-dang img-rm ## clean dangling and jupyter images
img-list: ## list jupyter images
......@@ -119,15 +118,22 @@ img-rm-dang: ## remove dangling images (tagged None)
@echo "Removing dangling images ..."
-docker rmi --force $(shell docker images -f "dangling=true" -q) 2> /dev/null
docs: ## build HTML documentation
make -C docs html
lint/%: ARGS?=
lint/%: ## lint the dockerfile(s) for a stack
@echo "Linting Dockerfiles in $(notdir $@)..."
@git ls-files --exclude='Dockerfile*' --ignored $(notdir $@) | grep -v ppc64 | xargs -L 1 $(HADOLINT) $(ARGS)
@echo "Linting done!"
n-docs-diff: ## number of docs/ files changed since branch from master
@git diff --name-only $(DIFF_RANGE) -- docs/ ':!docs/locale' | wc -l | awk '{print $$1}'
lint-all: $(foreach I,$(ALL_IMAGES),lint/$(I) ) ## lint all stacks
lint-build-test-all: $(foreach I,$(ALL_IMAGES),lint/$(I) arch_patch/$(I) build/$(I) test/$(I) ) ## lint, build and test all stacks
n-other-diff: ## number of files outside docs/ changed since branch from master
@git diff --name-only $(DIFF_RANGE) -- ':!docs/' | wc -l | awk '{print $$1}'
lint-install: ## install hadolint
@echo "Installing hadolint at $(HADOLINT) ..."
@curl -sL -o $(HADOLINT) "https://github.com/hadolint/hadolint/releases/download/v1.18.0/hadolint-$(shell uname -s)-$(shell uname -m)"
@chmod 700 $(HADOLINT)
@echo "Installation done!"
@$(HADOLINT) --version
pull/%: DARGS?=
pull/%: ## pull a jupyter image
......@@ -151,4 +157,4 @@ test/%: ## run tests against a stack (only common tests or common tests + specif
@if [ ! -d "$(notdir $@)/test" ]; then TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest -m "not info" test; \
else TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest -m "not info" test $(notdir $@)/test; fi
test-all: $(foreach I,$(ALL_IMAGES),test/$(I)) ## test all stacks
\ No newline at end of file
test-all: $(foreach I,$(ALL_IMAGES),test/$(I)) ## test all stacks
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment