1
0

hosts/web-2: Publish mitel-ommclient2 documentation using update-from-hydra

This commit is contained in:
2023-09-09 14:15:24 +02:00
parent e515212708
commit e2f58fd25c
4 changed files with 39 additions and 3 deletions

View File

@@ -2,6 +2,8 @@
set -euo pipefail
BUILD_OUTPUT="out"
while [[ $# -gt 0 ]]; do
case $1 in
--hydra-url)
@@ -29,6 +31,11 @@ while [[ $# -gt 0 ]]; do
shift
shift
;;
--build-output)
BUILD_OUTPUT="$2"
shift
shift
;;
--gcroot-name)
GCROOT_NAME="$2"
shift
@@ -50,13 +57,13 @@ set -- "${ARGS[@]}"
HYDRA_JOB_URL="${HYDRA_URL}/job/${HYDRA_PROJECT}/${HYDRA_JOBSET}/${HYDRA_JOB}/latest-finished"
RESULT_PATH="$1"
echo "Updating ${RESULT_PATH} from ${HYDRA_PROJECT}:${HYDRA_JOBSET}:${HYDRA_JOB}"
echo "Updating ${RESULT_PATH} from ${HYDRA_PROJECT}:${HYDRA_JOBSET}:${HYDRA_JOB} output ${BUILD_OUTPUT}"
echo "Make sure symlink directory exist"
mkdir -p "$(dirname "${RESULT_PATH}")"
echo "Fetching job output"
STORE_PATH="$(curl -s -L -H "Accept: application/json" "${HYDRA_JOB_URL}" | jq -r .buildoutputs.out.path)"
STORE_PATH="$(curl -s -L -H "Accept: application/json" "${HYDRA_JOB_URL}" | jq -r ".buildoutputs.${BUILD_OUTPUT}.path")"
echo "Copying path"
nix copy --from "${NIX_STORE_URI}" "${STORE_PATH}"