-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(action): migrate bootstrapping step to script
- Loading branch information
1 parent
5fe76cf
commit 041ac66
Showing
2 changed files
with
28 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
RUNNER_TEMP=${RUNNER_TEMP:?Must define RUNNER_TEMP env variable before running this script} | ||
CONFIGBAKER_IMAGE=${CONFIGBAKER_IMAGE:?Must define CONFIGBAKER_IMAGE env variable before running this script} | ||
GITHUB_OUTPUT=${GITHUB_OUTPUT:-$(mktemp)} | ||
|
||
mkdir -p "${RUNNER_TEMP}/dv" | ||
touch "${RUNNER_TEMP}/dv/bootstrap.exposed.env" | ||
|
||
echo "::group::🤖 Bootstrap Dataverse service" | ||
|
||
docker run -i --network apitest_dataverse \ | ||
-v "${RUNNER_TEMP}/dv/bootstrap.exposed.env:/.env" \ | ||
"${CONFIGBAKER_IMAGE}" bootstrap.sh -e /.env dev | ||
|
||
echo "::endgroup::" | ||
|
||
# Expose outputs | ||
grep "API_TOKEN" "${RUNNER_TEMP}/dv/bootstrap.exposed.env" >> "$GITHUB_OUTPUT" | ||
echo "base_url=http://localhost:8080/" >> "$GITHUB_OUTPUT" | ||
|
||
# Expose version | ||
version=$(curl -s 'http://localhost:8080/api/info/version' | jq -r '.data.version') | ||
echo "dv_version=$version" >>"$GITHUB_OUTPUT" |