diff --git a/ci/bash-lib.yml b/ci/bash-lib.yml index 332b6bc4da..deb631456f 100644 --- a/ci/bash-lib.yml +++ b/ci/bash-lib.yml @@ -81,9 +81,11 @@ steps: key=$(mktemp) # There may already be a trap; this will save it restore_trap=$(trap -p EXIT) - cleanup="rm -rf $key ~/.config/gcloud" - trap "$cleanup" EXIT + config_dir=$(mktemp -d) + cleanup="rm -rf $key $config_dir" + trap "$cleanup; $restore_trap" EXIT echo "$cred" > $key + export CLOUDSDK_CONFIG="$config_dir" gcloud auth activate-service-account --key-file=$key BOTO_CONFIG=/dev/null gsutil $cmd "${args[@]}" diff --git a/ci/cron/src/Main.hs b/ci/cron/src/Main.hs index 4aed6a77f8..c3760807f0 100644 --- a/ci/cron/src/Main.hs +++ b/ci/cron/src/Main.hs @@ -344,6 +344,7 @@ verify_signatures :: FilePath -> FilePath -> String -> IO () verify_signatures bash_lib tmp version_tag = do System.callCommand $ unlines ["bash -c '", "set -euo pipefail", + "export DADE_SKIP_JAVA=1", "eval \"$(dev-env/bin/dade assist)\"", "source \"" <> bash_lib <> "\"", "shopt -s extglob", -- enable !() pattern: things that _don't_ match @@ -370,6 +371,7 @@ does_backup_exist :: String -> FilePath -> FilePath -> IO Bool does_backup_exist gcp_credentials bash_lib path = do out <- shell $ unlines ["bash -c '", "set -euo pipefail", + "export DADE_SKIP_JAVA=1", "eval \"$(dev-env/bin/dade assist)\"", "source \"" <> bash_lib <> "\"", "GCRED=$(cat < FilePath -> FilePath -> FilePath -> IO () gcs_cp gcp_credentials bash_lib local_path remote_path = do shell_ $ unlines ["bash -c '", "set -euo pipefail", + "export DADE_SKIP_JAVA=1", "eval \"$(dev-env/bin/dade assist)\"", "source \"" <> bash_lib <> "\"", "GCRED=$(cat < do download_assets temp_dir release verify_signatures bash_lib temp_dir v - Control.Monad.Extra.whenJust gcp_credentials $ \gcred -> - Directory.listDirectory temp_dir >>= Data.Foldable.traverse_ (\f -> do + Control.Monad.Extra.whenJust gcp_credentials $ \gcred -> do + files <- Directory.listDirectory temp_dir + Control.Concurrent.Async.forConcurrently_ files $ \f -> do let local_github = temp_dir f let local_gcp = temp_dir f <> ".gcp" let remote_gcp = "gs://daml-data/releases/" <> v <> "/github/" <> f @@ -429,7 +433,7 @@ check_releases gcp_credentials bash_lib max_releases = do True -> putStrLn $ f <> " matches GCS backup." False -> Exit.die $ f <> " does not match GCS backup." else do - Exit.die $ remote_gcp <> " does not exist. Aborting.")) + Exit.die $ remote_gcp <> " does not exist. Aborting.") data CliArgs = Docs | Check { bash_lib :: String, diff --git a/dev-env/bin/dade-assist b/dev-env/bin/dade-assist index 6c4dcf7a6a..a1d163fb28 100755 --- a/dev-env/bin/dade-assist +++ b/dev-env/bin/dade-assist @@ -2,7 +2,7 @@ DADE_CURRENT_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$DADE_CURRENT_SCRIPT_DIR/../lib/dade-common" - -linkTool java out "${DADE_DEVENV_DIR}/jdk" - +if [ -z "${DADE_SKIP_JAVA+1}" ]; then + linkTool java out "${DADE_DEVENV_DIR}/jdk" +fi exec "${DADE_DEVENV_DIR}/lib/dade-dump-profile"