diff --git a/Dockerfiles/Dockerfile.selenium-jenkins b/Dockerfiles/Dockerfile.selenium-jenkins deleted file mode 100755 index be7f956a9..000000000 --- a/Dockerfiles/Dockerfile.selenium-jenkins +++ /dev/null @@ -1,22 +0,0 @@ -FROM python:3.11 -# For build CBC Jenkins job ECR image -ENV PYTHONUNBUFFERED 1 -# ENV PYTHONDEVMODE 1 - -RUN mkdir /code -ADD . /code/ -WORKDIR /code - -RUN pip install --upgrade pip - -RUN apt-get update && apt-get install -yq git unzip curl - -# Install Chrome for Selenium -RUN curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /chrome.deb \ - && dpkg -i /chrome.deb || apt-get install -yf \ - && rm /chrome.deb - -# Install chromedriver for Selenium -RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip \ - && unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/ \ - && chmod +x /usr/local/bin/chromedriver diff --git a/Dockerfiles/Dockerfile.selenium-jenkins-python311 b/Dockerfiles/Dockerfile.selenium-jenkins-python311 deleted file mode 100755 index 9f31ac753..000000000 --- a/Dockerfiles/Dockerfile.selenium-jenkins-python311 +++ /dev/null @@ -1,18 +0,0 @@ -FROM --platform=linux/amd64 python:3.11 -# For build CBC Jenkins job ECR image -ENV PYTHONUNBUFFERED 1 - -RUN mkdir /code -ADD . /code/ -WORKDIR /code - -RUN pip install --upgrade pip -RUN apt-get update && apt-get install -yq git unzip curl -# Install Chrome for Selenium -RUN curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /chrome.deb \ - && dpkg -i /chrome.deb || apt-get install -yf \ - && rm /chrome.deb -# Install chromedriver for Selenium -RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip \ - && unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/ \ - && chmod +x /usr/local/bin/chromedriver diff --git a/Dockerfiles/Dockerfile.selenium-jenkins-python311-plus-chromedriver b/Dockerfiles/Dockerfile.selenium-jenkins-python311-plus-chromedriver new file mode 100644 index 000000000..4edc89e03 --- /dev/null +++ b/Dockerfiles/Dockerfile.selenium-jenkins-python311-plus-chromedriver @@ -0,0 +1,27 @@ +FROM --platform=linux/amd64 python:3.11 +# For build CBC Jenkins job ECR image +ENV PYTHONUNBUFFERED 1 + +RUN mkdir /code +ADD . /code/ +WORKDIR /code + +RUN pip install --upgrade pip +RUN apt-get update && apt-get install -yq git unzip curl + +# Install Chrome for Selenium +RUN curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /chrome.deb \ + && dpkg -i /chrome.deb || apt-get install -yf \ + && rm /chrome.deb + +# Install chromedriver for Selenium: keep the previous chrome driver install code for reference +# RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip \ +# && unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/ \ +# && chmod +x /usr/local/bin/chromedriver + +# hard code the zip URL here since `curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` still points to 114 which is out of date +# this is the current way google publish the chrome drivers, going forward, need to make changes to keep up with the way google publish the +# drivers. +RUN wget -O /tmp/chromedriver.zip https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.108/linux64/chromedriver-linux64.zip \ + && unzip -p /tmp/chromedriver.zip chromedriver-linux64/chromedriver > /usr/local/bin/chromedriver \ + && chmod +x /usr/local/bin/chromedriver diff --git a/Dockerfiles/readme.md b/Dockerfiles/readme.md index 9dd2bf502..5d9395243 100755 --- a/Dockerfiles/readme.md +++ b/Dockerfiles/readme.md @@ -1,13 +1,11 @@ -# Build, Tag, and Publish integration and selenium tests ECR iamge +# Build, Tag, and Publish integration and selenium tests ECR image - used by github CI check Go to BB2 local repo base directory and do the followings (assume aws cli installed and configured properly): ``` - aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/f5g8o1y9 cd /Dockerfiles -docker build -f Dockerfile.selenium-jenkins -t bb2-cbc-build-selenium . -docker tag bb2-cbc-build-selenium:latest public.ecr.aws/f5g8o1y9/bb2-cbc-build-selenium:latest -docker push public.ecr.aws/f5g8o1y9/bb2-cbc-build-selenium:latest - -``` \ No newline at end of file +docker build -f Dockerfile.selenium-jenkins-python311-plus-chromedriver -t bb2-cbc-build-selenium-python311-chromium . +docker tag bb2-cbc-build-selenium-python311-chromium:latest public.ecr.aws/f5g8o1y9/bb2-cbc-build-selenium-python311-chromium:latest +docker push public.ecr.aws/f5g8o1y9/bb2-cbc-build-selenium-python311-chromium:latest +```