Skip to content

Commit

Permalink
feat(ci): Update the pom to release on oss
Browse files Browse the repository at this point in the history
Update the ci to run the right command
Fix the licence

ref #10
  • Loading branch information
Marthym committed Nov 16, 2020
1 parent 4a827c9 commit 08466f5
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 9 deletions.
16 changes: 11 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ maven:test:
artifacts:
reports:
junit: [
testy-beat-box/target/surefire-reports/TEST-*.xml,
testy-core-box/target/surefire-reports/TEST-*.xml,
testy-jooq-box/target/surefire-reports/TEST-*.xml,
testy-mongo-box/target/surefire-reports/TEST-*.xml
Expand All @@ -96,6 +97,7 @@ maven:release:
dependencies:
- maven:build
script:
- echo ${GPG_PASSPHRASE} | gpg --batch --import "${GPG_SECRET_KEY}"
- git checkout -B "$CI_BUILD_REF_NAME"
- mvn ${MAVEN_CLI_OPTS} -DdryRun=true release:prepare
- git clean -f
Expand All @@ -107,13 +109,13 @@ maven:release:
-DscmCommentPrefix="[maven-release][skip CI] " \
-DdevelopmentVersion="$(.gitlab/bumpVersion.sh)" \
release:perform \
-Darguments="-DskipTests=true -Dmaven.javadoc.skip=true"
-Darguments="-DskipTests=true"
- git clone "[email protected]:${CI_PROJECT_PATH}.git"
- cd "${CI_PROJECT_NAME}"
- git checkout master
- |
git merge --no-ff \
-m "[maven-release][skip CI] Merge release in master" origin/develop~1
-m "[maven-release][skip CI] Merge release in master" origin/develop
- git push origin master
rules:
- if: >
Expand All @@ -135,15 +137,19 @@ maven:sonar:
- if: '$CI_COMMIT_REF_NAME == "develop"'
when: always

maven:deploy:
maven:deploy-snapshot:
stage: deploy
dependencies:
- maven:build
script: mvn ${MAVEN_CLI_OPTS} deploy -DskipTests
script: |
mvn ${MAVEN_CLI_OPTS} deploy \
-DskipTests \
-DaltDeploymentRepository="nexus::default::https://nexus.i-run.fr/repository/snapshots/" \
-DaltSnapshotDeploymentRepository="nexus" \
-DaltReleaseDeploymentRepository="ossrh"
rules:
- if: >
$CI_COMMIT_REF_NAME == "develop"
|| $CI_COMMIT_REF_NAME == "master"
when: always
⚙trigger:unchained:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2018 I-RUN.fr
Copyright 2020 i-Run.fr

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
167 changes: 164 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>fr.irun</groupId>
Expand All @@ -10,12 +11,23 @@
<artifactId>testy-box</artifactId>
<version>1.2.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Testy Box</name>
<description>A JUnit 5 tools library.</description>
<url>https://github.com/i-Run/testy-box</url>
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>

<scm>
<connection>scm:git:[email protected]:nora/rocket/testy-box.git</connection>
<developerConnection>scm:git:[email protected]:nora/rocket/testy-box.git</developerConnection>
<url>https://gitlab.i-run.fr/nora/rocket/testy-box</url>
<tag>HEAD</tag>
</scm>
<tag>HEAD</tag>
</scm>

<modules>
<module>testy-mongo-box</module>
Expand All @@ -28,6 +40,13 @@
<flapdoodle.version>2.1.1</flapdoodle.version>
<javax.inject.version>1</javax.inject.version>
<qpid.version>7.1.7</qpid.version>

<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<maven-scm-provider-gitexe.version>1.11.2</maven-scm-provider-gitexe.version>
<maven-scm-api.version>1.11.2</maven-scm-api.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -68,4 +87,146 @@

</dependencies>
</dependencyManagement>

<distributionManagement>
<snapshotRepository>
<id>nexus</id>
<url>https://nexus.i-run.fr/repository/snapshots/</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<profiles>
<profile>
<id>releases</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${maven-release-plugin.version}</version>
<configuration>
<localCheckout>true</localCheckout>
<pushChanges>false</pushChanges>
<mavenExecutorId>forked-path</mavenExecutorId>
<releaseProfiles>releases</releaseProfiles>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>${maven-scm-provider-gitexe.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-api</artifactId>
<version>${maven-scm-api.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>verify</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<useAgent>true</useAgent>
<passphrase>${env.GPG_PASSPHRASE}</passphrase>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus-staging-maven-plugin.version}</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<developers>
<developer>
<id>bnwander</id>
<name>Bertrand Neuenschwander</name>
<organization>i-Run</organization>
<organizationUrl>https://www.i-run.fr</organizationUrl>
</developer>
<developer>
<id>cdeverre</id>
<name>Christophe Deverre</name>
<organization>i-Run</organization>
<organizationUrl>https://www.i-run.fr</organizationUrl>
</developer>
<developer>
<id>fcombes</id>
<name>Frédéric Combes</name>
<organization>i-Run</organization>
<organizationUrl>https://www.i-run.fr</organizationUrl>
</developer>
</developers>
</project>

0 comments on commit 08466f5

Please sign in to comment.