Add git branch info

This commit is contained in:
iFargle
2023-02-10 21:49:56 +09:00
parent b98c07b241
commit 604bb44e61
3 changed files with 10 additions and 5 deletions

10
Jenkinsfile vendored
View File

@@ -5,7 +5,7 @@ pipeline {
label 'linux-x64'
}
environment {
APP_VERSION = '0.2.1'
APP_VERSION = 'v0.2.1'
}
options {
buildDiscarder(logRotator(numToKeepStr: '100', artifactNumToKeepStr: '20'))
@@ -22,11 +22,15 @@ pipeline {
steps {
script {
forgejoImage = docker.build("albert/headscale-webui:${env.BRANCH_NAME}-${env.BUILD_ID}",
"--label \"GIT_COMMIT=${env.GIT_COMMIT}\" --build-arg \"GIT_COMMIT=${env.GIT_COMMIT}\" "
"--label \"GIT_COMMIT=${env.GIT_COMMIT}\" "
+ " --build-arg \"GIT_COMMIT=${env.GIT_COMMIT}\" "
+ " --build-arg \"GIT_BRANCH=${env.BRANCH_NAME}\" "
+ " ."
)
ghcrImage = docker.build("ifargle/headscale-webui:${env.BRANCH_NAME}-${env.BUILD_ID}",
"--label \"GIT_COMMIT=${env.GIT_COMMIT}\" --build-arg \"GIT_COMMIT=${env.GIT_COMMIT}\" "
"--label \"GIT_COMMIT=${env.GIT_COMMIT}\" "
+ " --build-arg \"GIT_COMMIT=${env.GIT_COMMIT}\" "
+ " --build-arg \"GIT_BRANCH=${env.BRANCH_NAME}\" "
+ " ."
)
}

View File

@@ -22,9 +22,9 @@ app.logger.setLevel(logging.DEBUG)
COLOR_NAV = "blue-grey darken-1"
COLOR_BTN = "blue-grey darken-3"
BASE_PATH = os.environ["BASE_PATH"]
APP_VERSION = "0.2.1"
APP_VERSION = "v0.2.1"
GIT_COMMIT = os.environ["GIT_COMMIT"]
HS_VERSION = "0.20.0"
HS_VERSION = "v0.20.0"
DEBUG_STATE = False
@app.route('/')

View File

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