summaryrefslogtreecommitdiffstats
path: root/ansible_collections/hetzner/hcloud/tests/utils/gitlab/integration.sh
blob: c94392b85e4339c5aa7be07df177f84de911c7c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash

target="$1"

HCLOUD_TOKEN=$(cat hcloud_token.txt)
# shellcheck disable=SC2034,SC2154
changed_all_target="shippable/${cloud}/smoketest/"

# shellcheck disable=SC2046
echo "[default]
hcloud_api_token=${HCLOUD_TOKEN}
" >> $(pwd)/tests/integration/cloud-config-hcloud.ini
export SHIPPABLE="true"

# shellcheck disable=SC2155
export SHIPPABLE_BUILD_NUMBER="gl-$(cat prefix.txt)"

# shellcheck disable=SC2155,SC2002
export SHIPPABLE_JOB_NUMBER="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 2 | head -n 1)"
ansible-test integration --color --local -vv "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"}