Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

devops: switch docker publishing to a bash script (#3704)

Andrey Lushnikovef5c87ccea40
diff --git a/.github/workflows/publish_canary_docker.yml b/.github/workflows/publish_canary_docker.yml
index 4d7b230560..446f345b89 100644
--- a/.github/workflows/publish_canary_docker.yml
+++ b/.github/workflows/publish_canary_docker.yml
@@ -21,15 +21,16 @@ jobs:
node-version: 10.15
- run: npm ci
- run: npm run build
- - run: ./docs/docker/build.sh --prepare-context
- - uses: docker/build-push-action@v1
- with:
- username: playwright
- password: ${{ secrets.DOCKER_PASSWORD }}
- registry: playwright.azurecr.io
- repository: public/playwright
- path: docs/docker/
- dockerfile: docs/docker/Dockerfile.bionic
- tags: next
- tag_with_sha: true
+ - name: login & publish to docker
+ run: |
+ # login to docker
+ docker login --username playwright --password ${{ secrets.DOCKER_PASSWORD }} playwright.azurecr.io
+ # build docker image
+ ./docs/docker/build.sh
+ # tag image accordingly
+ docker tag playwright:localbuild public/playwright:next
+ docker tag playwright:localbuild public/playwright:sha-$(git rev-parse HEAD)
+ docker rmi playwright:localbuild
+ # push image to registry
+ docker push public/playwright:next
diff --git a/docs/docker/build.sh b/docs/docker/build.sh
index c09d718c23..d529318c3e 100755
--- a/docs/docker/build.sh
+++ b/docs/docker/build.sh
@@ -3,7 +3,7 @@ set -e
set +x
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
- echo "usage: $(basename $0) [--prepare-only]"
+ echo "usage: $(basename $0)"
echo
echo "Build Playwright docker image and tag it as 'playwright:localbuild'."
echo "Once image is built, you can run it with"
@@ -12,22 +12,12 @@ if [[ ($1 == '--help') || ($1 == '-h') ]]; then
echo ""
echo "NOTE: this requires on Playwright dependencies to be installed with 'npm install'"
echo " and Playwright itself being built with 'npm run build'"
- echo
- echo " --prepare-context prepare docker context and skip building."
- echo " This is to defer building & publishing to Docker Github Action."
echo ""
exit 0
fi
-PREPARE_CONTEXT_ONLY=""
-if [[ $1 == "--prepare-context" ]]; then
- PREPARE_CONTEXT_ONLY="1"
-fi
-
function cleanup() {
- if [[ -z "${PREPARE_CONTEXT_ONLY}" ]]; then
- rm -f "playwright.tar.gz"
- fi
+ rm -f "playwright.tar.gz"
}
trap "cleanup; cd $(pwd -P)" EXIT
@@ -37,8 +27,4 @@ cd "$(dirname "$0")"
# image.
node ../../packages/build_package.js playwright ./playwright.tar.gz
-if [[ -n "${PREPARE_CONTEXT_ONLY}" ]]; then
- exit 0
-fi
-
docker build -t "playwright:localbuild" -f Dockerfile.bionic .