Passed chrome driver version through environment variable

This commit is contained in:
butomo1989 2018-07-05 20:10:47 +02:00
parent e22b8f141e
commit e4180a6e65
2 changed files with 6 additions and 4 deletions

View file

@ -89,12 +89,14 @@ ARG PROCESSOR=x86
ARG SYS_IMG=x86
ARG IMG_TYPE=google_apis
ARG BROWSER=android
ARG CHROME_DRIVER=24
ENV ANDROID_VERSION=$ANDROID_VERSION \
API_LEVEL=$API_LEVEL \
PROCESSOR=$PROCESSOR \
SYS_IMG=$SYS_IMG \
IMG_TYPE=$IMG_TYPE \
BROWSER=$BROWSER
BROWSER=$BROWSER \
CHROME_DRIVER=2.40
ENV PATH ${PATH}:${ANDROID_HOME}/build-tools
RUN yes | sdkmanager --licenses && \
sdkmanager "platforms;android-${API_LEVEL}" "system-images;android-${API_LEVEL};${IMG_TYPE};${SYS_IMG}" "emulator"
@ -103,8 +105,7 @@ RUN yes | sdkmanager --licenses && \
# Download latest version of chromedriver
# to be able to use Chrome browser in emulator
#==============================================
RUN LATEST_VERSION=$(curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE) \
&& wget -nv -O chrome.zip "https://chromedriver.storage.googleapis.com/$LATEST_VERSION/chromedriver_linux64.zip" \
RUN wget -nv -O chrome.zip "https://chromedriver.storage.googleapis.com/${CHROME_DRIVER}/chromedriver_linux64.zip" \
&& unzip -x chrome.zip \
&& rm chrome.zip

View file

@ -57,6 +57,7 @@ function get_android_versions() {
get_android_versions
processors=x86
chrome_driver=$(curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE)
function test() {
# Prepare needed parameter to run tests
@ -146,7 +147,7 @@ function build() {
echo "[BUILD] Dockerfile: $FILE_NAME"
docker build -t $image_version --build-arg ANDROID_VERSION=$v --build-arg API_LEVEL=$level \
--build-arg PROCESSOR=$p --build-arg SYS_IMG=$sys_img --build-arg IMG_TYPE=$IMG_TYPE \
--build-arg BROWSER=$BROWSER -f $FILE_NAME .
--build-arg BROWSER=$BROWSER --build-arg CHROME_DRIVER=$chrome_driver -f $FILE_NAME .
docker tag $image_version $image_latest
done
}