-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #293 from freezingsaddles/fix-confusing-login-mess…
…age-take-2 Fix confusing login message, add version banner
- Loading branch information
Showing
29 changed files
with
148 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ build/* | |
dist/* | ||
env*/* | ||
data/* | ||
*.cfg | ||
*.db | ||
*.dump | ||
.idea | ||
|
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 |
---|---|---|
@@ -1,14 +1,17 @@ | ||
*.cfg | ||
*.egg-info | ||
*.pyc | ||
*.tmp | ||
.env* | ||
.venv* | ||
/*.iml | ||
/build | ||
/data/cache/* | ||
/dist | ||
/env | ||
/freezing/web/utils/meta.py | ||
/local_settings.py | ||
/resources/docker/db/sql-scripts | ||
/resources/docker/settings.cfg | ||
/src | ||
tmp.* |
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,19 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# freeze.sh | ||
# | ||
# Overwrite freezing/meta.py with the current commit, branch name and build date. | ||
|
||
# Set unofficial bash strict mode http://redsymbol.net/articles/unofficial-bash-strict-mode/ | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
# Thanks https://stackoverflow.com/a/64195658/424301 | ||
SHORT_SHA="$(echo "${GITHUB_SHA:-unknown}" | cut -c1-8)" | ||
GITHUB_REF_NAME=${GITHUB_REF_NAME:-unknown} | ||
|
||
cat <<EOF > "freezing/meta.py" | ||
commit = "$SHORT_SHA" | ||
branch = "$GITHUB_REF_NAME" | ||
build_date = "$(date -u +'%Y%m%dT%H%M%SZ')" | ||
EOF |
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,42 @@ | ||
#!/usr/bin/env python3 | ||
# meta.py | ||
# | ||
# Metadata about the built version of this package | ||
# | ||
# The bin/freeze.sh script will replace this file with | ||
# frozen values of commit, build_date, and branch. | ||
|
||
import datetime | ||
import subprocess | ||
|
||
|
||
# Thanks https://stackoverflow.com/a/21901260/424301 | ||
def get_git_revision_short_hash() -> str: | ||
return ( | ||
subprocess.check_output(["git", "rev-parse", "--short", "HEAD"]) | ||
.decode("ascii") | ||
.strip() | ||
) | ||
|
||
|
||
def get_git_branch() -> str: | ||
return ( | ||
subprocess.check_output(["git", "symbolic-ref", "-q", "HEAD"]) | ||
.decode("ascii") | ||
.strip() | ||
.replace("refs/heads/", "") | ||
) | ||
|
||
|
||
def freeze(): | ||
return f""" | ||
commit = "{get_git_revision_short_hash()}" | ||
build_date = "{datetime.datetime.utcnow().strftime('%Y%m%dT%H%M%SZ')}" | ||
branch = "{get_git_branch()}" | ||
""" | ||
|
||
|
||
# Thanks https://stackoverflow.com/a/4546755/424301 for inspiration | ||
commit = get_git_revision_short_hash() | ||
build_date = datetime.datetime.utcnow().strftime("%Y%m%dT%H%M%SZ") | ||
branch = get_git_branch() |
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
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
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
Oops, something went wrong.