Commit 05560081 authored by Denis Konovalyenko's avatar Denis Konovalyenko

Deploy to private nexus.

parent 6f79aa33
......@@ -2,67 +2,72 @@ image: maven:3.5.4-jdk-8
stages:
- build
- test
- deploy_snapshot
- deploy_release
- ci_status
- snapshot
- release
- status
variables:
MAVEN_CLI_OPTS: "-s ci/gitlab/.m2/settings.xml --batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=ci/gitlab/.m2/repository"
MAVEN_SETTINGS: "./ci/gitlab/.m2/settings.xml"
MAVEN_CLI_OPTS: "--settings ${MAVEN_SETTINGS} --batch-mode --update-snapshots"
# CI_DEBUG_TRACE: "true"
cache:
paths:
- ci/gitlab/.m2/repository/
- target/
- ${HOME}/.m2/repository/
- ${HOME}/target/
#before_script:
# - cat ${MAVEN_SETTINGS}
# - sed -i ${MAVEN_SETTINGS} -e "s/<username>.*<\/username>/<username>${MAVEN_REPO_USER}<\/username>/"
# - sed -i {$MAVEN_SETTINGS} -e "s/<password>.*<\/password>/<password>${MAVEN_REPO_PASS}<\/password>/"
# - sed -i "" -e "s/<username>.*<\/username>/<username>$MAVEN_REPO_USER<\/username>/" ${MAVEN_SETTINGS}
# - sed -i "" -e "s/<password>.*<\/password>/<password>$MAVEN_REPO_PASS<\/password>/" ${MAVEN_SETTINGS}
build:
stage: build
script:
- mvn $MAVEN_CLI_OPTS compile
test:
stage: test
script:
- mvn $MAVEN_CLI_OPTS test
- mvn test ${MAVEN_CLI_OPTS}
- mvn help:effective-settings ${MAVEN_CLI_OPTS}
deploy_snaphot:
stage: deploy_snapshot
snaphot:
stage: snapshot
script:
- echo "${GPG_KEY_SECRET}" | gpg --allow-secret-key-import --import
- gpg --list-keys
- mvn $MAVEN_CLI_OPTS deploy -DskipITs -Dmaven.test.skip=true -q -U -P release,sign_and_deploy
# - echo "${GPG_KEY_SECRET}" | gpg --allow-secret-key-import --import
# - gpg --list-keys
- mvn deploy ${MAVEN_CLI_OPTS} -DskipITs -Dmaven.test.skip=true --activate-profiles release --debug
# only:
# - dev
except:
- tags
- master
deploy_release:
stage: deploy_release
release:
stage: release
script:
- echo "${GPG_KEY_SECRET}" | gpg --allow-secret-key-import --import
- gpg --list-keys
- mvn $MAVEN_CLI_OPTS deploy -DskipITs -Dmaven.test.skip=true -q -U -P release,sign_and_deploy
# - echo "${GPG_KEY_SECRET}" | gpg --allow-secret-key-import --import
# - gpg --list-keys
- mvn deploy ${MAVEN_CLI_OPTS} -DskipITs -Dmaven.test.skip=true --activate-profiles release --quite
only:
- tags
except:
- branches
success:
stage: ci_status
stage: status
before_script:
- ""
after_script:
- ""
script:
- BUILD_STATUS=passed BUILD_KEY=push ./ci/gitlab/build_status
- BUILD_STATUS=passed BUILD_KEY=push ./ci/gitlab/build-status
when: on_success
failure:
stage: ci_status
stage: status
before_script:
- ""
after_script:
- ""
script:
- BUILD_STATUS=failed BUILD_KEY=push ./ci/gitlab/build_status
- BUILD_STATUS=failed BUILD_KEY=push ./ci/gitlab/build-status
when: on_failure
......@@ -2,10 +2,15 @@
<settings>
<servers>
<server>
<id>nexus</id>
<username>${env.MAVEN_REPO_USER}</username>
<password>${env.MAVEN_REPO_PASS}</password>
<id>osshr</id>
<username>${MAVEN_REPO_USER}</username>
<password>${MAVEN_REPO_PASS}</password>
</server>
<!--<server>-->
<!--<id>osshrs</id>-->
<!--<username>${MAVEN_REPO_USER}</username>-->
<!--<password>${MAVEN_REPO_PASS}</password>-->
<!--</server>-->
</servers>
<profiles>
......@@ -18,5 +23,26 @@
<argLine>-Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>
</properties>
</profile>
<!--<profile>-->
<!--<id>release</id>-->
<!--<repositories>-->
<!--<repository>-->
<!--<id>ossrh</id>-->
<!--<name>Releases Repository for Downloads</name>-->
<!--<url>http://91.211.13.180:8081/nexus/content/repositories/releases/</url>-->
<!--<snapshots>-->
<!--<enabled>false</enabled>-->
<!--</snapshots>-->
<!--</repository>-->
<!--<repository>-->
<!--<id>ossrhs</id>-->
<!--<name>Snapshots Repository for Downloads</name>-->
<!--<url>http://91.211.13.180:8081/nexus/content/repositories/snapshots/</url>-->
<!--<snapshots>-->
<!--<enabled>true</enabled>-->
<!--</snapshots>-->
<!--</repository>-->
<!--</repositories>-->
<!--</profile>-->
</profiles>
</settings>
......@@ -44,26 +44,17 @@
<distributionManagement>
<repository>
<id>releases</id>
<name>Nexus Releases</name>
<url>http://91.211.13.180:8081/content/repositories/releases/</url>
<id>ossrh</id>
<name>Nexus Releases for Uploads</name>
<url>http://91.211.13.180:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Nexus Snapshots</name>
<url>http://91.211.13.180:8081/content/repositories/snapshots/</url>
<id>ossrh</id>
<name>Nexus Snapshots for Uploads</name>
<url>http://91.211.13.180:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>okapi-xliff</id>
<name>okapi-xliff-repository</name>
<url>http://repository-okapi.forge.cloudbees.com/release/</url>
<layout>default</layout>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
......@@ -153,89 +144,91 @@
</build>
<profiles>
<profile>
<id>sign_and_deploy</id>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>false</skip>
<lockMode>never</lockMode>
<defaultKeyring>false</defaultKeyring>
<useAgent>false</useAgent>
<gpgArguments>
<arg>--no-random-seed-file</arg>
<arg>--no-permission-warning</arg>
</gpgArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<id>attach-sources</id>
<goals>
<goal>deploy</goal>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
<configuration>
<serverId>nexus</serverId>
<nexusUrl>http://91.211.13.180:8081/</nexusUrl>
<!-- Set this to true and the release will automatically proceed and sync to Central Repository will follow -->
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<doclint>none</doclint>
</configuration>
<executions>
<execution>
<id>attach-sources</id>
<id>attach-javadocs</id>
<goals>
<goal>jar-no-fork</goal>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!--<plugin>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-gpg-plugin</artifactId>-->
<!--<version>1.5</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>sign-artifacts</id>-->
<!--<phase>verify</phase>-->
<!--<goals>-->
<!--<goal>sign</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<!--<configuration>-->
<!--<skip>false</skip>-->
<!--<lockMode>never</lockMode>-->
<!--<defaultKeyring>false</defaultKeyring>-->
<!--<useAgent>false</useAgent>-->
<!--<gpgArguments>-->
<!--<arg>&#45;&#45;no-random-seed-file</arg>-->
<!--<arg>&#45;&#45;no-permission-warning</arg>-->
<!--</gpgArguments>-->
<!--</configuration>-->
<!--</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<doclint>none</doclint>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<executions>
<execution>
<id>attach-javadocs</id>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>jar</goal>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>http://91.211.13.180:8081/nexus/</nexusUrl>
<!-- Set this to true and the release will automatically proceed and sync to Central Repository will follow -->
<autoReleaseAfterClose>false</autoReleaseAfterClose>
<!--<skipLocalStaging>true</skipLocalStaging>-->
</configuration>
</plugin>
</plugins>
</build>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment