Skip to content

Commit

Permalink
Merge pull request #111 from georchestra/debian-package
Browse files Browse the repository at this point in the history
maven/build - adds a debian packaging profile
  • Loading branch information
pmauduit authored Mar 20, 2024
2 parents 638e3c8 + 3a29ee6 commit 7344454
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ docker:
echo tagging georchestra/gateway:$${TAG} as georchestra/gateway:latest && \
docker tag georchestra/gateway:$${TAG} georchestra/gateway:latest && \
docker images|grep "georchestra/gateway"|grep latest

deb: install
./mvnw package deb:package -f gateway/ -PdebianPackage
92 changes: 92 additions & 0 deletions gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -360,5 +360,97 @@
</plugins>
</build>
</profile>
<profile>
<id>debianPackage</id>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.9.10</version>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<prefix>build</prefix>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
<skipPoms>false</skipPoms>
<verbose>false</verbose>
<gitDescribe>
<tags>true</tags>
</gitDescribe>
<injectIntoSysProperties>true</injectIntoSysProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>copy-deb-resources</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<outputDirectory>${project.build.directory}/deb</outputDirectory>
<resources>
<resource>
<directory>src/deb/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>set-project-packageversion</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<exportAntProperties>true</exportAntProperties>
<target>
<condition else="99.main.${maven.build.timestamp}~${build.commit.id.abbrev}" property="project.packageVersion" value="${build.closest.tag.name}.${maven.build.timestamp}~${build.commit.id.abbrev}">
<matches pattern="\d{2}\.\d\.x$" string="${build.branch}"></matches>
</condition>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.sf.debian-maven</groupId>
<artifactId>debian-maven-plugin</artifactId>
<version>1.0.6</version>
<configuration>
<packageName>georchestra-gateway</packageName>
<packageDescription>geOrchestra Gateway</packageDescription>
<packageVersion>${project.packageVersion}</packageVersion>
<projectOrganization>geOrchestra</projectOrganization>
<maintainerName>PSC</maintainerName>
<maintainerEmail>psc@georchestra.org</maintainerEmail>
<excludeAllDependencies>true</excludeAllDependencies>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
</properties>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public interface AccountManager {
* @param mappedUser the user {@link ResolveGeorchestraUserGlobalFilter}
* resolved by calling
* {@link GeorchestraUserMapper#resolve(Authentication)}
* @return the stored version of the user if it exists, otherwise an empty Optional
* @return the stored version of the user if it exists, otherwise an empty
* Optional
*/
Optional<GeorchestraUser> find(GeorchestraUser mappedUser);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,10 @@ private WebTestClient.RequestHeadersUriSpec<?> prepareWebTestClientHeaders(
.is2xxSuccessful()//
.expectBody()//
.jsonPath("$.GeorchestraUser").isNotEmpty()//
.jsonPath("$.GeorchestraUser.roles").value(Matchers.contains("ROLE_ADMINISTRATOR", //
.jsonPath("$.GeorchestraUser.roles").value(Matchers.hasItems("ROLE_ADMINISTRATOR", //
"ROLE_SUPERUSER", //
"ROLE_GN_ADMIN", //
"ROLE_IMPORT", //
"ROLE_USER", //
"ROLE_MAPSTORE_ADMIN", //
"ROLE_EMAILPROXY"));
Expand Down

0 comments on commit 7344454

Please sign in to comment.