Files
nebula.js/tools/update-baseline.sh
renovate[bot] 5097bf83d0 chore(deps): update minor and patch (#1275)
* chore(deps): update minor and patch

* chore: set update snapshots to all

* chore: update baseline

* chore: remove all

* chore: update baseline more

* chore: update baseline max

* chore: update baseline maxi

* chore: update baseline maxis

* chore: update baseline maxisu

* chore: update baseline maxisum

* chore: update baseline maxisumo

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: caele <tsm@qlik.com>
2023-05-22 15:43:21 +02:00

33 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Script to update baseline images of rendering tests
# Fetches /regression/ artifacts from specified circleci build and downloads the new images into /baseline/
# Requires following env variables to run:
# CIRCLE_TOKEN - your API token, see https://circleci.com/docs/2.0/managing-api-tokens/#creating-a-personal-api-token
# BUILD - The circleci build number of the job containing the artifacts
# REPO - The github repo
# Example:
# CIRCLE_TOKEN=xxx BUILD=10639 REPO=qlik-oss/nebula.js ./tools/update-baseline.sh
# WARNING: DOESN*T FULLY WORK, requires some manual labor
set -eo pipefail
# https://circleci.com/docs/2.0/artifacts/#downloading-all-artifacts-for-a-build-on-circleci
artifacts=$(curl https://circleci.com/api/v1.1/project/github/$REPO/$BUILD/artifacts?circle-token=$CIRCLE_TOKEN | jq -r '.[].url' | grep '/test/rendering/listbox/listbox.spec.js-snapshots/')
for artifact in $artifacts
do
remote="$artifact?circle-token=$CIRCLE_TOKEN"
echo $remote
local=${artifact#*-artifacts.com/}
echo $local
local=${local/regression/baseline}
local=./${local#*/}
wget -v $remote
done