-
-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
attempting to fix docker image build by generating frontend version i…
…nformation before docker build.
- Loading branch information
Showing
8 changed files
with
42 additions
and
54 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
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
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,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ -z "${CI}" ]]; then | ||
echo "running locally (not in Github Actions). generating version file from git client" | ||
GIT_TAG=`git describe --tags` | ||
GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` | ||
|
||
if [[ "$GIT_BRANCH" == "master" ]]; then | ||
VERSION_INFO="${GIT_TAG}" | ||
else | ||
VERSION_INFO="${GIT_BRANCH}#${GIT_TAG}" | ||
fi | ||
else | ||
echo "running in Github Actions, generating version file from environmental variables" | ||
# https://docs.github.com/en/actions/learn-github-actions/environment-variables | ||
GITHUB_SHA | ||
GITHUB_REF_NAME | ||
GITHUB_REF_TYPE | ||
|
||
VERSION_INFO="${GITHUB_REF_NAME}" | ||
|
||
if [[ "$GITHUB_REF_TYPE" == "branch" ]]; then | ||
VERSION_INFO="${VERSION_INFO}#${GITHUB_SHA::7}" | ||
fi | ||
fi | ||
|
||
echo "writing version file (version: ${VERSION_INFO})" | ||
cat <<EOT > src/environments/versions.ts | ||
// this file is automatically generated by git.version.ts script | ||
export const versionInfo = { | ||
version: '${VERSION_INFO}', | ||
}; | ||
EOT |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
|
||
// this file is automatically generated by git.version.ts script | ||
export const versionInfo = { | ||
version: 'v0.0.0', | ||
version: 'dev', | ||
}; |