From 4c572afd1173b5bd49fa2def3b54ea552fccee85 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Fri, 19 Apr 2024 18:55:22 +0700 Subject: [PATCH] [build][doc]: upgrade browser with remain on same the Selenium version (#2217) Signed-off-by: Viet Nguyen Duc --- Makefile | 21 +++++++++++++++++++++ README.md | 25 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/Makefile b/Makefile index bfa1ff0a0..3e34fa10d 100644 --- a/Makefile +++ b/Makefile @@ -157,6 +157,27 @@ count_image_layers: docker history $(NAME)/standalone-docker:$(TAG_VERSION) -q | wc -l docker history $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) -q | wc -l +chrome_upgrade_version: + cd ./NodeChrome && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(VERSION) --build-arg AUTHORS=$(AUTHORS) -t $(NAME)/node-chrome:$(TAG_VERSION) . + cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-chrome -t $(NAME)/standalone-chrome:$(TAG_VERSION) . + docker run --rm $(NAME)/standalone-chrome:$(TAG_VERSION) /opt/selenium/selenium-server.jar info --version + docker run --rm $(NAME)/standalone-chrome:$(TAG_VERSION) google-chrome --version + docker run --rm $(NAME)/standalone-chrome:$(TAG_VERSION) chromedriver --version + +firefox_upgrade_version: + cd ./NodeFirefox && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(VERSION) --build-arg AUTHORS=$(AUTHORS) -t $(NAME)/node-firefox:$(TAG_VERSION) . + cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-firefox -t $(NAME)/standalone-firefox:$(TAG_VERSION) . + docker run --rm $(NAME)/standalone-firefox:$(TAG_VERSION) /opt/selenium/selenium-server.jar info --version + docker run --rm $(NAME)/standalone-firefox:$(TAG_VERSION) firefox --version + docker run --rm $(NAME)/standalone-firefox:$(TAG_VERSION) geckodriver --version + +edge_upgrade_version: + cd ./NodeEdge && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(VERSION) --build-arg AUTHORS=$(AUTHORS) -t $(NAME)/node-edge:$(TAG_VERSION) . + cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-edge -t $(NAME)/standalone-edge:$(TAG_VERSION) . + docker run --rm $(NAME)/standalone-edge:$(TAG_VERSION) /opt/selenium/selenium-server.jar info --version + docker run --rm $(NAME)/standalone-edge:$(TAG_VERSION) microsoft-edge --version + docker run --rm $(NAME)/standalone-edge:$(TAG_VERSION) msedgedriver --version + # https://github.com/SeleniumHQ/docker-selenium/issues/992 # Additional tags for browser images tag_and_push_browser_images: tag_and_push_chrome_images tag_and_push_firefox_images tag_and_push_edge_images diff --git a/README.md b/README.md index d5722bca9..d43871f9c 100644 --- a/README.md +++ b/README.md @@ -1027,6 +1027,31 @@ $ BUILD_ARGS="--build-arg SEL_USER=yourseluser --build-arg SEL_PASSWD=welcome" m ``` ___ +## Upgrade browser version in the images + +Selenium server, browser and driver are pre-installed in the image. In case you would like to remain on the same Selenium version and just upgrade the browser and its driver to the latest. You can follow below steps + +Clone the repo and from the project directory root you can upgrade by running: + +```bash +$ VERSION=$EXPECTED_SELENIUM_VERSION make chrome_upgrade_version +``` +For example: `VERSION=4.16.1 make chrome_upgrade_version` + +The new image has tag `$VERSION_YYYYMMDD` where `YYYYMMDD` is the current date. + +```bash +$ VERSION=$SELENIUM_VERSION make firefox_upgrade_version +``` + +```bash +$ VERSION=$SELENIUM_VERSION make edge_upgrade_version +``` + +You can refer to detail commands in the [Makefile](Makefile) file. + +--- + ## Waiting for the Grid to be ready It is a good practice to check first if the Grid is up and ready to receive requests, this can be done by checking the `/wd/hub/status` endpoint.