diff --git a/.github/workflows/docker-build-test-upload.yml b/.github/workflows/docker-build-test-upload.yml index 1c288e82..a96059cd 100644 --- a/.github/workflows/docker-build-test-upload.yml +++ b/.github/workflows/docker-build-test-upload.yml @@ -1,5 +1,8 @@ name: Download parent image, build new one, test it and upload to GitHub artifacts +env: + OWNER: ${{ github.repository_owner }} + on: workflow_call: inputs: @@ -45,7 +48,7 @@ jobs: platform: ${{ inputs.platform }} - name: Build image 🛠 - run: docker build --rm --force-rm --tag jupyter/${{ inputs.image }} ${{ inputs.image }}/ + run: docker build --rm --force-rm --tag ${{ env.OWNER }}/${{ inputs.image }} ${{ inputs.image }}/ env: DOCKER_BUILDKIT: 1 # Full logs for CI build @@ -53,11 +56,11 @@ jobs: shell: bash - name: Run tests ✅ - run: python3 -m tests.run_tests --short-image-name ${{ inputs.image }} + run: python3 -m tests.run_tests --short-image-name ${{ inputs.image }} --owner ${{ env.OWNER }} shell: bash - name: Save image as a tar for later use 💾 - run: docker save jupyter/${{ inputs.image }} -o /tmp/${{ inputs.image }}-${{ inputs.platform }}.tar + run: docker save ${{ env.OWNER }}/${{ inputs.image }} -o /tmp/${{ inputs.image }}-${{ inputs.platform }}.tar shell: bash - name: Upload image as artifact 💾 uses: actions/upload-artifact@v3 diff --git a/.github/workflows/docker-tag-manifest-push.yml b/.github/workflows/docker-tag-manifest-push.yml index ced13f63..a7d676c6 100644 --- a/.github/workflows/docker-tag-manifest-push.yml +++ b/.github/workflows/docker-tag-manifest-push.yml @@ -1,5 +1,8 @@ name: Download Docker image from GitHub artifacts, tag and push it to DockerHub +env: + OWNER: ${{ github.repository_owner }} + on: workflow_call: inputs: @@ -54,12 +57,12 @@ jobs: - name: Create tags 🏷 run: | - python3 -m tagging.tag_image --short-image-name ${{ matrix.image }} + python3 -m tagging.tag_image --short-image-name ${{ matrix.image }} --owner ${{ env.OWNER }} docker image ls -a shell: bash - name: Write manifest and build history file 🏷 - run: python3 -m tagging.write_manifest --short-image-name ${{ matrix.image }} --hist-line-dir /tmp/hist_lines/ --manifest-dir /tmp/manifests/ + run: python3 -m tagging.write_manifest --short-image-name ${{ matrix.image }} --hist-line-dir /tmp/hist_lines/ --manifest-dir /tmp/manifests/ --owner ${{ env.OWNER }} shell: bash - name: Upload manifest file 💾 uses: actions/upload-artifact@v3 @@ -76,7 +79,7 @@ jobs: - name: Remove aarch64 latest tag 🗑️ if: ${{ inputs.platform != 'amd64' }} - run: docker rmi jupyter/${{ matrix.image }} + run: docker rmi ${{ env.OWNER }}/${{ matrix.image }} shell: bash - name: Login to Docker Hub 🔐 @@ -88,5 +91,5 @@ jobs: - name: Push Images to Docker Hub 📤 if: github.ref == 'refs/heads/main' || github.event_name == 'schedule' - run: docker push --all-tags jupyter/${{ matrix.image }} + run: docker push --all-tags ${{ env.OWNER }}/${{ matrix.image }} shell: bash diff --git a/.github/workflows/hub-overview.yml b/.github/workflows/hub-overview.yml index 8a9bcc9c..4882549d 100644 --- a/.github/workflows/hub-overview.yml +++ b/.github/workflows/hub-overview.yml @@ -1,5 +1,8 @@ name: Update dockerhub overviews +env: + OWNER: ${{ github.repository_owner }} + on: push: branches: @@ -36,7 +39,7 @@ jobs: DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }} DOCKER_PASS: ${{ secrets.DOCKERHUB_TOKEN }} with: - destination_container_repo: jupyter/base-notebook + destination_container_repo: ${{ env.OWNER }}/base-notebook provider: dockerhub short_description: "Small base image for Jupyter Notebook stacks from https://github.com/jupyter/docker-stacks" readme_file: base-notebook/README.md diff --git a/tagging/tag_image.py b/tagging/tag_image.py index 5e65d3d4..1df2d84a 100755 --- a/tagging/tag_image.py +++ b/tagging/tag_image.py @@ -50,7 +50,11 @@ if __name__ == "__main__": required=True, help="Short image name to apply tags for", ) - arg_parser.add_argument("--owner", default="jupyter", help="Owner of the image") + arg_parser.add_argument( + "--owner", + required=True, + help="Owner of the image", + ) args = arg_parser.parse_args() tag_image(args.short_image_name, args.owner) diff --git a/tagging/write_manifest.py b/tagging/write_manifest.py index 5c2b1f6d..06e890ce 100755 --- a/tagging/write_manifest.py +++ b/tagging/write_manifest.py @@ -120,7 +120,11 @@ if __name__ == "__main__": type=Path, help="Directory to save manifest file", ) - arg_parser.add_argument("--owner", default="jupyter", help="Owner of the image") + arg_parser.add_argument( + "--owner", + required=True, + help="Owner of the image", + ) args = arg_parser.parse_args() LOGGER.info(f"Current build timestamp: {BUILD_TIMESTAMP}") diff --git a/tests/run_tests.py b/tests/run_tests.py index 5a49d2b7..f8ab85f7 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -41,7 +41,11 @@ if __name__ == "__main__": required=True, help="Short image name to run test on", ) - arg_parser.add_argument("--owner", default="jupyter", help="Owner of the image") + arg_parser.add_argument( + "--owner", + required=True, + help="Owner of the image", + ) args = arg_parser.parse_args()