diff --git a/.github/workflows/publish_canary.yml b/.github/workflows/publish_canary.yml index 78ddf58af7..18d527b2a8 100644 --- a/.github/workflows/publish_canary.yml +++ b/.github/workflows/publish_canary.yml @@ -10,7 +10,7 @@ on: jobs: publish-canary: - name: "publish canary NPM & Trigger canary Docker" + name: "publish canary NPM & Publish canary Docker" runs-on: ubuntu-20.04 if: github.repository == 'microsoft/playwright' steps: diff --git a/.github/workflows/publish_release_docker.yml b/.github/workflows/publish_release_docker.yml index d24cdf97ee..cd597d083c 100644 --- a/.github/workflows/publish_release_docker.yml +++ b/.github/workflows/publish_release_docker.yml @@ -4,6 +4,7 @@ on: workflow_dispatch: inputs: is_release: + required: true type: boolean description: "Is this a release image?" diff --git a/utils/docker/Dockerfile.bionic b/utils/docker/Dockerfile.bionic index b15a27b045..0ef4ace7ee 100644 --- a/utils/docker/Dockerfile.bionic +++ b/utils/docker/Dockerfile.bionic @@ -10,20 +10,16 @@ RUN apt-get update && \ apt-get install -y curl wget && \ curl -sL https://deb.nodesource.com/setup_16.x | bash - && \ apt-get install -y nodejs && \ - # Feature-parity with node.js base images. apt-get install -y --no-install-recommends git openssh-client && \ npm install -g yarn && \ - # Install Python 3.8 apt-get install -y python3.8 python3-pip && \ update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 && \ update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \ update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 && \ - # clean apt cache rm -rf /var/lib/apt/lists/* && \ - # Create the pwuser (we internally create a symlink for the pwuser and the root user) adduser pwuser diff --git a/utils/docker/Dockerfile.focal b/utils/docker/Dockerfile.focal index 0a65ffd9e2..4bd08f54b7 100644 --- a/utils/docker/Dockerfile.focal +++ b/utils/docker/Dockerfile.focal @@ -6,25 +6,20 @@ ARG TZ=America/Los_Angeles # === INSTALL Node.js === RUN apt-get update && \ - # Install node16 apt-get install -y curl wget && \ curl -sL https://deb.nodesource.com/setup_16.x | bash - && \ apt-get install -y nodejs && \ - # Feature-parity with node.js base images. apt-get install -y --no-install-recommends git openssh-client && \ npm install -g yarn && \ - # Install Python 3.8 apt-get install -y python3.8 python3-pip && \ update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 && \ update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \ update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 && \ - # clean apt cache rm -rf /var/lib/apt/lists/* && \ - # Create the pwuser adduser pwuser diff --git a/utils/docker/publish_docker.sh b/utils/docker/publish_docker.sh index 4b918257f8..7dba94bd8b 100755 --- a/utils/docker/publish_docker.sh +++ b/utils/docker/publish_docker.sh @@ -6,7 +6,9 @@ set +x trap "cd $(pwd -P)" EXIT cd "$(dirname "$0")" +MCR_IMAGE_NAME="playwright" PW_VERSION=$(node -e 'console.log(require("../../package.json").version)') + RELEASE_CHANNEL="$1" if [[ "${RELEASE_CHANNEL}" == "stable" ]]; then if [[ "${PW_VERSION}" == *-* ]]; then @@ -50,6 +52,14 @@ if [[ "$RELEASE_CHANNEL" == "stable" ]]; then FOCAL_TAGS+=("focal") fi +tag_and_push() { + local source="$1" + local target="$2" + echo "-- tagging: $target" + docker tag $source $target + docker push $target +} + publish_docker_images_with_arch_suffix() { local FLAVOR="$1" local TAGS=() @@ -72,7 +82,7 @@ publish_docker_images_with_arch_suffix() { for ((i = 0; i < ${#TAGS[@]}; i++)) do local TAG="${TAGS[$i]}" - ./tag_and_push.sh playwright:localbuild "playwright.azurecr.io/public/playwright:${TAG}-${ARCH}" + tag_and_push playwright:localbuild "playwright.azurecr.io/public/${MCR_IMAGE_NAME}:${TAG}-${ARCH}" done } @@ -90,7 +100,7 @@ publish_docker_manifest () { for ((i = 0; i < ${#TAGS[@]}; i++)) do local TAG="${TAGS[$i]}" - local BASE_IMAGE_TAG="playwright.azurecr.io/public/playwright:${TAG}" + local BASE_IMAGE_TAG="playwright.azurecr.io/public/${MCR_IMAGE_NAME}:${TAG}" local IMAGE_NAMES="" if [[ "$2" == "arm64" || "$2" == "amd64" ]]; then IMAGE_NAMES="${IMAGE_NAMES} ${BASE_IMAGE_TAG}-$2" diff --git a/utils/docker/tag_and_push.sh b/utils/docker/tag_and_push.sh deleted file mode 100755 index 9c5b09d2e2..0000000000 --- a/utils/docker/tag_and_push.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -echo "-- tagging: $2" -docker tag $1 $2 -docker push $2