Show exact commit hash of Admin UI in interface (#1572)

This commit is contained in:
Jon Koops 2021-11-22 12:41:12 +01:00 committed by GitHub
parent bb46594d84
commit 71350cacd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 0 deletions

View file

@ -104,6 +104,19 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<version>5.0.0</version>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>maven-replacer-plugin</artifactId>
@ -142,6 +155,7 @@
"resourceUrl": "${resourceUrl}",
"masterRealm": "${masterRealm}",
"resourceVersion": "${resourceVersion}",
"commitHash": "${git.commit.id}",
"isRunningAsTheme": true
}
</script>

View file

@ -160,6 +160,9 @@ const Dashboard = () => {
</Card>
</GridItem>
</Grid>
<Text className="pf-u-font-size-sm pf-u-color-200 pf-u-mt-sm">
{t("adminUiVersion", { version: environment.commitHash })}
</Text>
</PageSection>
</>
);

View file

@ -13,5 +13,6 @@ export default {
infoEnabledFeatures: "Something about what enabled features are.",
infoDisabledFeatures: "Something about what disabled features are.",
disabledFeatures: "Disabled features",
adminUiVersion: "Admin UI version: {{version}}",
},
};

View file

@ -12,6 +12,8 @@ export type Environment = {
masterRealm: string;
/** The version hash of the auth sever. */
resourceVersion: string;
/** The hash of the commit the Admin UI was built on, useful to determine the exact version the user is running. */
commitHash: string;
/** Indicates if the application is running as a Keycloak theme. */
isRunningAsTheme: boolean;
};
@ -29,6 +31,7 @@ const defaultEnvironment: Environment = {
resourceUrl: ".",
masterRealm: "master",
resourceVersion: "unknown",
commitHash: "unknown",
isRunningAsTheme: false,
};