Add GIT_COMMIT Environment variable to container build in Jenkins

This commit is contained in:
iFargle
2023-02-10 21:32:28 +09:00
parent 3ddc5c5cd9
commit 498a3f54dd
3 changed files with 4 additions and 0 deletions

2
Jenkinsfile vendored
View File

@@ -23,10 +23,12 @@ pipeline {
script {
forgejoImage = docker.build("albert/headscale-webui:${env.BRANCH_NAME}-${env.BUILD_ID}",
"--label \"GIT_COMMIT=${env.GIT_COMMIT}\""
+ "--environment \"GIT_COMMIT=${env.GIT_COMMIT}\""
+ " ."
)
ghcrImage = docker.build("ifargle/headscale-webui:${env.BRANCH_NAME}-${env.BUILD_ID}",
"--label \"GIT_COMMIT=${env.GIT_COMMIT}\""
+ "--environment \"GIT_COMMIT=${env.GIT_COMMIT}\""
+ " ."
)
}

View File

@@ -23,6 +23,7 @@ COLOR_NAV = "blue-grey darken-1"
COLOR_BTN = "blue-grey darken-3"
BASE_PATH = os.environ["BASE_PATH"]
APP_VERSION = "0.2.1"
GIT_COMMIT = os.environ["GIT_COMMIT"]
HS_VERSION = "0.20.0"
DEBUG_STATE = False

View File

@@ -34,6 +34,7 @@
<span class="card-title">About</span>
<p>Developed with Flask, Python, MaterializeCSS, and jQuery.</p>
<p>Version: {{ APP_VERSION }}</p>
<p>Commit: {{ GIT_COMMIT }}</p>
<p>Tested on Headscale {{ HS_VERSION }}</p>
<p>Repository: <a href="https://github.com/iFargle/headscale-webui">Github</a>.</p>
</div>