From a7eaf7f64ced031ec01dfd5c620622fb927487ba Mon Sep 17 00:00:00 2001 From: Ricardo N Feliciano Date: Thu, 12 Jan 2023 11:36:04 -0500 Subject: [PATCH] fix: correct checkout directory error (#63) * fix: correct checkout directory error * Using working dir envar instead of hardcoding Co-authored-by: Kyle a.k.a. TechSquidTV <33272306+KyleTryon@users.noreply.github.com> * Try Eric's approach Co-authored-by: Kyle a.k.a. TechSquidTV <33272306+KyleTryon@users.noreply.github.com> --- .circleci/config.yml | 3 +-- .circleci/test-deploy.yml | 5 ++++- src/scripts/install-chrome.sh | 2 +- src/scripts/install-chromedriver.sh | 9 ++++++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a878fb0..b82da21 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,8 +25,7 @@ workflows: vcs-type: << pipeline.project.type >> requires: [orb-tools/lint, orb-tools/review, orb-tools/pack, shellcheck/check] - # Use a context to hold your publishing token. - context: orb-publisher + context: image-orbs github-token: GHI_TOKEN filters: *filters # Triggers the next workflow in the Orb Development Kit. diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index 3378de7..b80aec2 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -41,6 +41,9 @@ jobs: - jq/install - browser-tools/install-chrome: channel: << parameters.channel >> + - browser-tools/install-chromedriver + # checkout step is added last to satisfy a test + - checkout int-test-chrome: parameters: executor: @@ -184,7 +187,7 @@ workflows: - test-cimg-node-firefox - test-macos-firefox - test-linux-firefox - context: orb-publisher + context: image-orbs filters: branches: ignore: /.*/ diff --git a/src/scripts/install-chrome.sh b/src/scripts/install-chrome.sh index bb42396..b7948ca 100644 --- a/src/scripts/install-chrome.sh +++ b/src/scripts/install-chrome.sh @@ -116,7 +116,7 @@ else $SUDO sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' fi $SUDO apt-get update - $SUDO apt-get install -y google-chrome-${ORB_PARAM_CHANNEL} + DEBIAN_FRONTEND=noninteractive $SUDO apt-get install -y google-chrome-${ORB_PARAM_CHANNEL} else # Google does not keep older releases in their PPA, but they can be installed manually. HTTPS should be enough to secure the download. wget --no-verbose -O /tmp/chrome.deb "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${ORB_PARAM_CHROME_VERSION}-1_amd64.deb" \ diff --git a/src/scripts/install-chromedriver.sh b/src/scripts/install-chromedriver.sh index e663560..2f8fbfb 100644 --- a/src/scripts/install-chromedriver.sh +++ b/src/scripts/install-chromedriver.sh @@ -3,7 +3,12 @@ if [[ $EUID == 0 ]]; then export SUDO=""; else export SUDO="sudo"; fi # determine_chrome_version if uname -a | grep Darwin >/dev/null 2>&1; then echo "System detected as MacOS" - CHROME_VERSION="$(/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version)" + + if [ -f "/usr/local/bin/google-chrome-stable" ]; then + CHROME_VERSION="$(/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version)" + else + CHROME_VERSION="$(/Applications/Google\ Chrome\ Beta.app/Contents/MacOS/Google\ Chrome\ Beta --version)" + fi PLATFORM=mac64 elif grep Alpine /etc/issue >/dev/null 2>&1; then @@ -157,6 +162,8 @@ $SUDO chmod +x "$ORB_PARAM_DRIVER_INSTALL_DIR/chromedriver" # test/verify version if chromedriver --version | grep "$CHROMEDRIVER_VERSION" >/dev/null 2>&1; then echo "$(chromedriver --version) has been installed to $(command -v chromedriver)" + readonly base_dir="${CIRCLE_WORKING_DIRECTORY/\~/$HOME}" + rm -f "${base_dir}/LICENSE.chromedriver" else echo "Something went wrong; ChromeDriver could not be installed" exit 1