Merge pull request #10091 from danfengliu/update-e2e-dockerfile-to-latest

Maintain E2E image Dockerfile
This commit is contained in:
danfengliu 2019-12-12 14:04:53 +08:00 committed by GitHub
commit 6d80803dbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 53 additions and 13 deletions

View File

@ -16,7 +16,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
sshpass \ sshpass \
ant \ ant \
ant-optional \ ant-optional \
openjdk-7-jdk \ xvfb \
libxi6 \
libgconf-2-4 \
openjdk-8-jdk \
rpcbind \ rpcbind \
nfs-common \ nfs-common \
unzip \ unzip \
@ -32,7 +35,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
netcat \ netcat \
# Add headless chrome support # Add headless chrome support
google-chrome-stable \ google-chrome-stable \
Xvfb \
# Speed up ISO builds with already installed reqs # Speed up ISO builds with already installed reqs
yum \ yum \
yum-utils \ yum-utils \
@ -46,14 +48,26 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
apt-get autoremove -y && \ apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
RUN wget -N http://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip && \
unzip chromedriver_linux64.zip && \
chmod +x chromedriver && \
mv -f chromedriver /usr/local/share/chromedriver && \
ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver && \
ln -s /usr/local/share/chromedriver /usr/bin/chromedriver
RUN apt-get update && apt install libnss3-tools && \
mkdir -p $HOME/.pki/nssdb && \
echo Harbor12345 > password.ca && \
certutil -d sql:$HOME/.pki/nssdb -N -f password.ca
RUN wget https://bootstrap.pypa.io/get-pip.py && \ RUN wget https://bootstrap.pypa.io/get-pip.py && \
python ./get-pip.py && \ python ./get-pip.py && \
pip install pyasn1 google-apitools==0.5.15 gsutil robotframework robotframework-sshlibrary robotframework-httplibrary requests dbbot robotframework-selenium2library robotframework-pabot --upgrade pip install pyasn1 google-apitools==0.5.15 gsutil robotframework==3.0.4 robotframework-sshlibrary robotframework-httplibrary requests dbbot robotframework-selenium2library robotframework-pabot robotframework-JSONLibrary --upgrade
# Install docker, docker compose # Install docker, docker compose
RUN wget https://download.docker.com/linux/static/stable/x86_64/docker-17.12.0-ce.tgz && \ RUN wget https://download.docker.com/linux/static/stable/x86_64/docker-18.06.3-ce.tgz && \
tar --strip-components=1 -xvzf docker-17.12.0-ce.tgz -C /usr/bin && \ tar --strip-components=1 -xvzf docker-18.06.3-ce.tgz -C /usr/bin && \
curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && \ curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
chmod +x /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose
RUN wget https://github.com/drone/drone-cli/releases/download/v0.8.3/drone_linux_amd64.tar.gz && tar zxf drone_linux_amd64.tar.gz && \ RUN wget https://github.com/drone/drone-cli/releases/download/v0.8.3/drone_linux_amd64.tar.gz && tar zxf drone_linux_amd64.tar.gz && \
@ -62,8 +76,16 @@ RUN wget https://github.com/drone/drone-cli/releases/download/v0.8.3/drone_linux
RUN curl -sSL https://github.com/vmware/govmomi/releases/download/v0.16.0/govc_linux_amd64.gz | gzip -d > /usr/local/bin/govc && \ RUN curl -sSL https://github.com/vmware/govmomi/releases/download/v0.16.0/govc_linux_amd64.gz | gzip -d > /usr/local/bin/govc && \
chmod +x /usr/local/bin/govc chmod +x /usr/local/bin/govc
RUN wget https://launchpad.net/ubuntu/+source/wget/1.18-2ubuntu1/+build/10470166/+files/wget_1.18-2ubuntu1_amd64.deb && \ RUN wget https://get.helm.sh/helm-v2.14.1-linux-386.tar.gz && tar zxvf helm-v2.14.1-linux-386.tar.gz && \
dpkg -i wget_1.18-2ubuntu1_amd64.deb mv linux-386/helm /usr/local/bin/helm && \
helm init --client-only && \
helm plugin install https://github.com/chartmuseum/helm-push
RUN wget https://get.helm.sh/helm-v3.0.0-linux-386.tar.gz && tar zxvf helm-v3.0.0-linux-386.tar.gz && \
mv linux-386/helm /usr/local/bin/helm3 && \
helm3 plugin install https://github.com/chartmuseum/helm-push
# Add docker in docker support # Add docker in docker support
# version: docker:1.13-dind # version: docker:1.13-dind

View File

@ -35,7 +35,7 @@ fi
if [ "$1" = 'dockerd' ]; then if [ "$1" = 'dockerd' ]; then
# if we're running Docker, let's pipe through dind # if we're running Docker, let's pipe through dind
# (and we'll run dind explicitly with "sh" since its shebang is /bin/bash) # (and we'll run dind explicitly with "sh" since its shebang is /bin/bash)
set -- sh "$(which dind)" "$@" "--insecure-registry=$IP" set -- sh "$(which dind)" "$@" "--insecure-registry=0.0.0.0/0"
fi fi

View File

@ -177,7 +177,7 @@ Do Log Advanced Search
Retry Text Input xpath=//audit-log//hbr-filter//input harbor Retry Text Input xpath=//audit-log//hbr-filter//input harbor
Sleep 1 Sleep 1
Capture Page Screenshot LogAdvancedSearch2.png Capture Page Screenshot LogAdvancedSearch2.png
${rc} = Get Matching Xpath Count //audit-log//clr-dg-row ${rc} = Get Element Count //audit-log//clr-dg-row
Should Be Equal As Integers ${rc} 0 Should Be Equal As Integers ${rc} 0
Go Into Repo Go Into Repo

View File

@ -28,7 +28,7 @@ Helm Repo Add
Wait Unitl Command Success helm repo add --ca-file /helm_ca/server.crt --username=${user} --password=${pwd} ${helm_repo_name} ${harbor_url}/chartrepo/${project_name} Wait Unitl Command Success helm repo add --ca-file /helm_ca/server.crt --username=${user} --password=${pwd} ${helm_repo_name} ${harbor_url}/chartrepo/${project_name}
Helm Repo Push Helm Repo Push
[Arguments] ${harbor_url} ${user} ${pwd} ${chart_filename} ${project_name}=library ${helm_repo_name}=myrepo [Arguments] ${user} ${pwd} ${chart_filename} ${helm_repo_name}=myrepo
${current_dir}= Run pwd ${current_dir}= Run pwd
Run cd ${current_dir} Run cd ${current_dir}
Run wget ${harbor_chart_file_url} Run wget ${harbor_chart_file_url}

View File

@ -150,7 +150,18 @@ Helm CLI Push Without Sign In Harbor
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
Create An New Project project${d} Create An New Project project${d}
Helm Repo Add ${HARBOR_URL} ${sign_in_user} ${sign_in_pwd} project_name=project${d} Helm Repo Add ${HARBOR_URL} ${sign_in_user} ${sign_in_pwd} project_name=project${d}
Helm Repo Push ${HARBOR_URL} ${sign_in_user} ${sign_in_pwd} ${harbor_chart_filename} project_name=project${d} Helm Repo Push ${sign_in_user} ${sign_in_pwd} ${harbor_chart_filename}
Go Into Project project${d} has_image=${false}
Switch To Project Charts
Go Into Chart Version ${harbor_chart_name}
Retry Wait Until Page Contains ${harbor_chart_version}
Capture Page Screenshot
Helm3 CLI Push Without Sign In Harbor
[Arguments] ${sign_in_user} ${sign_in_pwd}
${d}= Get Current Date result_format=%m%s
Create An New Project project${d}
Helm Repo Push ${sign_in_user} ${sign_in_pwd} ${harbor_chart_filename} helm_repo_name=${HARBOR_URL}/chartrepo/project${d}
Go Into Project project${d} has_image=${false} Go Into Project project${d} has_image=${false}
Switch To Project Charts Switch To Project Charts
Go Into Chart Version ${harbor_chart_name} Go Into Chart Version ${harbor_chart_name}

View File

@ -33,3 +33,10 @@ Test Case - Helm CLI Push
${pwd}= Set Variable Test1@34 ${pwd}= Set Variable Test1@34
Sign In Harbor ${HARBOR_URL} ${user} ${pwd} Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
Helm CLI Push Without Sign In Harbor ${user} ${pwd} Helm CLI Push Without Sign In Harbor ${user} ${pwd}
Test Case - Helm3 CLI Push
Init Chrome Driver
${user}= Set Variable user004
${pwd}= Set Variable Test1@34
Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
Helm3 CLI Push Without Sign In Harbor ${user} ${pwd}