Skip to content

Commit

Permalink
Make version more detailed, move git plugin to parent (awslabs#369)
Browse files Browse the repository at this point in the history
* Change Git Commit id plugin to properly include git-created tags.

* Finish git plugin inheritance, implement utils gitVersion object and tests, change update to handle new model

* Change webapp footer to handle new version

* Update a small comment to clarify git command

* a couple of small changes before PR

* Replace the built-in API Gateway Cognito authorizer with a Lambda Authorizer (awslabs#368)

* Replace the built-in API Gateway Cognito authorizer with a Lambda
authorizer that does the same in preparation for supporting different
identity providers for API authorization.

* Clarifying comments in Cognito token verifier

* Change hash->commit, update git commit plugin for new authorizer function

Co-authored-by: PoeppingT <[email protected]>
Co-authored-by: brtrvn <[email protected]>
  • Loading branch information
3 people authored Oct 11, 2022
1 parent 8c1b005 commit 2bc4084
Show file tree
Hide file tree
Showing 33 changed files with 334 additions and 662 deletions.
20 changes: 19 additions & 1 deletion client/web/src/components/AppFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@ const AppFooter = (props) => {
const saasBoostEnvironment = useSelector((state) =>
selectSettingsById(state, 'SAAS_BOOST_ENVIRONMENT'),
)

const prettyVersion = (versionParameter) => {
let versionString = versionParameter?.value
try {
let versionObject = JSON.parse(versionString)
if (versionObject?.tag && versionObject?.describe && versionObject?.commit) {
if (versionObject.tag === versionObject.describe) {
versionString = versionObject.tag
} else {
versionString = versionObject.describe + "@" + versionObject.commit
}
}
} catch (e) {
console.error("Failed parsing VERSION: '" + versionString + "' to JSON", e)
}
return versionString
}

return (
<CFooter>
<span>
Expand All @@ -37,7 +55,7 @@ const AppFooter = (props) => {
&nbsp;&copy; Amazon.com, Inc.
</span>
<span className="ml-auto">
Version {version?.value} - {saasBoostEnvironment?.value}
Version {prettyVersion(version)} - {saasBoostEnvironment?.value}
</span>
</CFooter>
)
Expand Down
23 changes: 0 additions & 23 deletions functions/authorizer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,6 @@ limitations under the License.
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.0.0</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.commit.id.describe</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.describe-short</includeOnlyProperty>
<includeOnlyProperty>^git.commit.time</includeOnlyProperty>
<includeOnlyProperty>^git.closest.tag.name</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>../../.git</dotGitDirectory>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
27 changes: 2 additions & 25 deletions functions/core-stack-listener/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,8 @@ limitations under the License.
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.0.0</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.commit.id.describe</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.describe-short</includeOnlyProperty>
<includeOnlyProperty>^git.commit.time</includeOnlyProperty>
<includeOnlyProperty>^git.closest.tag.name</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>../../.git</dotGitDirectory>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
27 changes: 2 additions & 25 deletions functions/ecs-service-update/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,8 @@ limitations under the License.
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.0.0</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.commit.id.describe</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.describe-short</includeOnlyProperty>
<includeOnlyProperty>^git.commit.time</includeOnlyProperty>
<includeOnlyProperty>^git.closest.tag.name</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>../../.git</dotGitDirectory>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
27 changes: 2 additions & 25 deletions functions/ecs-shutdown-services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,8 @@ limitations under the License.
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.0.0</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.commit.id.describe</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.describe-short</includeOnlyProperty>
<includeOnlyProperty>^git.commit.time</includeOnlyProperty>
<includeOnlyProperty>^git.closest.tag.name</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>../../.git</dotGitDirectory>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
27 changes: 2 additions & 25 deletions functions/ecs-startup-services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,8 @@ limitations under the License.
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.0.0</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.commit.id.describe</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.describe-short</includeOnlyProperty>
<includeOnlyProperty>^git.commit.time</includeOnlyProperty>
<includeOnlyProperty>^git.closest.tag.name</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>../../.git</dotGitDirectory>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
27 changes: 2 additions & 25 deletions functions/onboarding-app-stack-listener/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,31 +58,8 @@ limitations under the License.
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.0.0</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.commit.id.describe</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.describe-short</includeOnlyProperty>
<includeOnlyProperty>^git.commit.time</includeOnlyProperty>
<includeOnlyProperty>^git.closest.tag.name</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>../../.git</dotGitDirectory>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
27 changes: 2 additions & 25 deletions functions/onboarding-stack-listener/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,8 @@ limitations under the License.
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.0.0</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.commit.id.describe</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.describe-short</includeOnlyProperty>
<includeOnlyProperty>^git.commit.time</includeOnlyProperty>
<includeOnlyProperty>^git.closest.tag.name</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>../../.git</dotGitDirectory>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
27 changes: 2 additions & 25 deletions functions/system-rest-api-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,8 @@ limitations under the License.
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.0.0</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.commit.id.describe</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.describe-short</includeOnlyProperty>
<includeOnlyProperty>^git.commit.time</includeOnlyProperty>
<includeOnlyProperty>^git.closest.tag.name</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>../../.git</dotGitDirectory>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
27 changes: 2 additions & 25 deletions functions/workload-deploy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,8 @@ limitations under the License.
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.0.0</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.commit.id.describe</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.describe-short</includeOnlyProperty>
<includeOnlyProperty>^git.commit.time</includeOnlyProperty>
<includeOnlyProperty>^git.closest.tag.name</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>../../.git</dotGitDirectory>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
27 changes: 2 additions & 25 deletions installer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,31 +78,8 @@ limitations under the License.
</executions>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.0.0</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.commit.id.describe</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.describe-short</includeOnlyProperty>
<includeOnlyProperty>^git.commit.time</includeOnlyProperty>
<includeOnlyProperty>^git.closest.tag.name</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>${project.basedir}/../.git</dotGitDirectory>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
Loading

0 comments on commit 2bc4084

Please sign in to comment.