Skip to content

Commit

Permalink
Changes in pom for release preparation
Browse files Browse the repository at this point in the history
+ Added Jenkinsfile for release pipeline(Just for reference)
+ Moved individual profiles into parent pom
  • Loading branch information
rohanKanojia committed Dec 18, 2019
1 parent 886826f commit 084ebeb
Show file tree
Hide file tree
Showing 8 changed files with 309 additions and 483 deletions.
65 changes: 65 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!groovy

pipeline {
agent any
tools {
maven 'apache-maven-latest'
jdk 'adoptopenjdk-hotspot-jdk8-latest'
}
stages {
stage('Build') {
steps {
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) {
sh 'gpg --batch --import "${KEYRING}"'
sh 'for fpr in $(gpg --list-keys --with-colons | awk -F: \'/fpr:/ {print $10}\' | sort -u); do echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key ${fpr} trust; done'
}
withCredentials([string(credentialsId: '00d22e13-04f3-432a-b95b-90893e93e70b', variable: 'GH_TOKEN')]) {
}
sh '''
# Setup Git Config
git config --global user.email eclipsejkubebot@eclipse.org
git config --global user.name "Eclipse Jkube Bot"
git clone https://eclipse-jkube-bot:$GH_TOKEN@github.com/eclipse/jkube.git && cd jkube
# Find Project release version
HEAD=$(git log -1 --format=format:%H)
PROJECT_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
NEXT_RELEASE_VERSION=`echo $PROJECT_VERSION | sed 's/-SNAPSHOT//g'`
if [ ${#NEXT_RELEASE_VERSION} -eq 3 ]; then
NEXT_RELEASE_VERSION=`echo "$NEXT_RELEASE_VERSION.0"`
fi
echo "Releasing project with version $NEXT_RELEASE_VERSION"
# Prepare project for release, modify pom to new release version
mvn versions:set -DnewVersion=$NEXT_RELEASE_VERSION
find . -iname *.versionsBackup -exec rm {} +
git add . && git commit -m "[RELEASE] Modified Project pom version to $NEXT_RELEASE_VERSION"
git tag $NEXT_RELEASE_VERSION
git push origin $NEXT_RELEASE_VERSION
git push origin master
mvn clean -B
mvn -V -B -e -U install org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7:deploy -P release -DnexusUrl=https://oss.sonatype.org -DserverId=ossrh
# Modify poms back to SNAPSHOT VERSIONS
MAJOR_VERSION=`echo $NEXT_RELEASE_VERSION | cut -d. -f1`
MINOR_VERSION=`echo $NEXT_RELEASE_VERSION | cut -d. -f2`
PATCH_VERSION=`echo $NEXT_RELEASE_VERSION | cut -d. -f3`
PATCH_VERSION=$(($PATCH_VERSION + 1))
NEXT_SNAPSHOT_VERSION=`echo "$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION-SNAPSHOT"`
mvn versions:set -DnewVersion=$NEXT_SNAPSHOT_VERSION
find . -iname *.versionsBackup -exec rm {} +
git add . && git commit -m "[RELEASE] Prepare project for next development iteration $NEXT_SNAPSHOT_VERSION"
git push origin master
# read repo_id from *.properties file and set it
repo_id=$(cat target/nexus-staging/staging/*.properties | grep id | awk -F'=' '{print $2}')
mvn -B org.sonatype.plugins:nexus-staging-maven-plugin:1.6.5:rc-release -DserverId=ossrh -DnexusUrl=https://oss.sonatype.org -DstagingRepositoryId=${repo_id} -Ddescription=\"Next release is ready\" -DstagingProgressTimeoutMinutes=60
'''
}
}
}
}

17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Jkube

[![Circle CI](https://circleci.com/gh/jkubeio/jkube/tree/master.svg?style=shield)](https://circleci.com/gh/jkubeio/jkube-kit/tree/master)
[![Circle CI](https://circleci.com/gh/eclipse/jkube/tree/master.svg?style=shield)](https://circleci.com/gh/eclipse/jkube/tree/master)
[![License](https://img.shields.io/badge/License-EPL%202.0-red.svg?label=license&logo=eclipse)](https://www.eclipse.org/legal/epl-2.0/)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=jkubeio_jkube&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=jkubeio_jkube)
[![Gitter](https://badges.gitter.im/jkube-community/community.svg)](https://gitter.im/jkube-community/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=jkubeio_jkube&metric=coverage)](https://sonarcloud.io/dashboard?id=jkubeio_jkube)
Expand All @@ -10,23 +11,23 @@ This project contains various building blocks for the jkube developer toolbox.
Actually it contains the following abstractions which has been extracted from both projects:

* **Kubernetes Maven Plugin** <br/>
[![Maven Central](https://img.shields.io/maven-central/v/io.jkube/k8s-maven-plugin.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.jkube%22%20AND%20a:%22k8s-maven-plugin%22)
[![Maven Central](https://img.shields.io/maven-central/v/org.eclipse/k8s-maven-plugin.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22org.eclipse%22%20AND%20a:%22k8s-maven-plugin%22)

* **Openshift Maven Plugin** <br/>
[![Maven Central](https://img.shields.io/maven-central/v/io.jkube/oc-maven-plugin.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.jkube%22%20AND%20a:%22oc-maven-plugin%22)
[![Maven Central](https://img.shields.io/maven-central/v/org.eclipse/oc-maven-plugin.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22org.eclipse%22%20AND%20a:%22oc-maven-plugin%22)

* **Jkube-kit**, which consists of the following:

* **Generator** framework for automatically generating Docker images by examining project information.<br />
[![Maven Central](https://img.shields.io/maven-central/v/io.jkube/jkube-maven-generator-api.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.jkube%22%20AND%20a:%22jkube-maven-generator-api%22) [![Javadocs](http://www.javadoc.io/badge/io.jkube/jkube-maven-generator-api.svg?color=blue)](http://www.javadoc.io/doc/io.jkube/jkube-maven-generator-api)
[![Maven Central](https://img.shields.io/maven-central/v/org.eclipse/jkube-maven-generator-api.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22org.eclipse%22%20AND%20a:%22jkube-maven-generator-api%22) [![Javadocs](http://www.javadoc.io/badge/org.eclipse/jkube-maven-generator-api.svg?color=blue)](http://www.javadoc.io/doc/org.eclipse/jkube-maven-generator-api)
* **Enricher** framework for creating and enhancing Kubernetes and OpenShift resources.<br />
[![Maven Central](https://img.shields.io/maven-central/v/io.jkube/jkube-maven-enricher-api.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.jkube%22%20AND%20a:%22jkube-maven-enricher-api%22) [![Javadocs](http://www.javadoc.io/badge/io.jkube/jkube-maven-enricher-api.svg?color=blue)](http://www.javadoc.io/doc/io.jkube/jkube-maven-enricher-api)
[![Maven Central](https://img.shields.io/maven-central/v/org.eclipse/jkube-maven-enricher-api.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22org.eclipse%22%20AND%20a:%22jkube-maven-enricher-api%22) [![Javadocs](http://www.javadoc.io/badge/org.eclipse/jkube-maven-enricher-api.svg?color=blue)](http://www.javadoc.io/doc/org.eclipse/jkube-maven-enricher-api)
* **Profile** combining the configuration for generators and enrichers.<br />
[![Maven Central](https://img.shields.io/maven-central/v/io.jkube/jkube-maven-profiles.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.jkube%22%20AND%20a:%22jkube-maven-profiles%22) [![Javadocs](http://www.javadoc.io/badge/io.jkube/jkube-maven-profiles.svg?color=blue)](http://www.javadoc.io/doc/io.jkube/jkube-maven-profiles)
[![Maven Central](https://img.shields.io/maven-central/v/org.eclipse/jkube-maven-profiles.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22org.eclipse%22%20AND%20a:%22jkube-maven-profiles%22) [![Javadocs](http://www.javadoc.io/badge/org.eclipse/jkube-maven-profiles.svg?color=blue)](http://www.javadoc.io/doc/org.eclipse/jkube-maven-profiles)
* **Resource configuration** model objects for a simplified configuration of Kubernetes and OpenShift resources.<br />
[![Maven Central](https://img.shields.io/maven-central/v/io.jkube/jkube-kit-config-resource.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.jkube%22%20AND%20a:%22jkube-kit-config-resource%22) [![Javadocs](http://www.javadoc.io/badge/io.jkube/jkube-kit-config-resource.svg?color=blue)](http://www.javadoc.io/doc/io.jkube/jkube-kit-config-resource)
[![Maven Central](https://img.shields.io/maven-central/v/org.eclipse/jkube-kit-config-resource.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22org.eclipse%22%20AND%20a:%22jkube-kit-config-resource%22) [![Javadocs](http://www.javadoc.io/badge/org.eclipse/jkube-kit-config-resource.svg?color=blue)](http://www.javadoc.io/doc/org.eclipse/jkube-kit-config-resource)
* **Image configuration** model objects for modeling Docker image configuration as used in docker-maven-plugin.<br />
[![Maven Central](https://img.shields.io/maven-central/v/io.jkube/jkube-kit-config-image.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.jkube%22%20AND%20a:%22jkube-kit-config-image%22) [![Javadocs](http://www.javadoc.io/badge/io.jkube/jkube-kit-config-image.svg?color=blue)](http://www.javadoc.io/doc/io.jkube/jkube-kit-config-image)
[![Maven Central](https://img.shields.io/maven-central/v/org.eclipse/jkube-kit-config-image.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22org.eclipse%22%20AND%20a:%22jkube-kit-config-image%22) [![Javadocs](http://www.javadoc.io/badge/org.eclipse/jkube-kit-config-image.svg?color=blue)](http://www.javadoc.io/doc/org.eclipse/jkube-kit-config-image)

One intention of extracting these parts from the originating plugins is also to separate Maven related and non-Maven related functionality so that the non-Maven parts can be reused for other build systems and IDEs like Gradle or Eclipse. Some thin adapter Maven specific modules like [jkube-kit-enricher-maven](enricher/maven/pom.xml) and [jkube-kit-generator-maven](generator/maven/pom.xml) are provided as glue to get to the Maven specific build information like the project's coordinates.

Expand Down
225 changes: 0 additions & 225 deletions jkube-kit/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,6 @@
<name>Jkube Kit :: Parent</name>
<description>${project.name}</description>

<url>http://github.com/jkubeio/jkube-kit</url>

<licenses>
<license>
<url>https://www.eclipse.org/legal/epl-2.0/</url>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>

<developers>
<developer>
<id>geeks</id>
<name>Jkube Development Team</name>
<email>jkube@googlegroups.com</email>
<organization>jkube</organization>
<organizationUrl>http://jkube.io/</organizationUrl>
</developer>
</developers>

<scm>
<connection>scm:git:git://github.com/jkubeio/jkube-kit.git</connection>
<developerConnection>scm:git:ssh://git@github.com/jkubeio/jkube-kit.git</developerConnection>
<tag>HEAD</tag>
<url>git://github.com/jkubeio/jkube-kit.git</url>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -71,7 +46,6 @@

<jmockit.version>1.43</jmockit.version>
<version.maven>3.3.1</version.maven>
<version.jacoco>0.8.2</version.jacoco>
<version.kubernetes-client>4.6.2</version.kubernetes-client>
<version.openshift-client>${version.kubernetes-client}</version.openshift-client>
<version.mockwebserver>0.0.13</version.mockwebserver>
Expand Down Expand Up @@ -136,34 +110,6 @@
<commons-compress.version>1.19</commons-compress.version>
</properties>


<repositories>
<repository>
<id>maven-central-plugin-snapshots</id>
<name>Maven Central Plugin Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<dependencyManagement>
<dependencies>

Expand Down Expand Up @@ -668,176 +614,5 @@
</extensions>
</build>

<profiles>
<!-- "release" profiles used for deploying with jkube -->
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-no-snapshots</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireReleaseDeps>
<message>No Snapshots Allowed!</message>
</requireReleaseDeps>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<!-- "milestone" profiles used for deploying manually -->
<profile>
<id>milestone</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<useAgent>true</useAgent>
<keyname>rhuss@redhat.com</keyname>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<!-- Enable JaCoCo test coverage -->
<profile>
<id>jacoco</id>

<dependencies>
<!-- JaCoCo runtime must be in classpath for offline mode -->
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.agent</artifactId>
<classifier>runtime</classifier>
<version>${version.jacoco}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>instrument</id>
<phase>process-classes</phase>
<goals>
<goal>instrument</goal>
</goals>
</execution>
<execution>
<id>restore</id>
<phase>test</phase>
<goals>
<goal>restore-instrumented-classes</goal>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<!-- JaCoCo runtime must know where to dump coverage: -->
<jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
</systemPropertyVariables>
</configuration>
</plugin>

</plugins>
</build>
</profile>


<!-- "doc-html" for creating the asciidocs -->
<profile>
<id>doc-html</id>
<build>
<plugins>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<configuration>
<backend>html</backend>
<sourceHighlighter>coderay</sourceHighlighter>
<attributes>
<toc>left</toc>
</attributes>
</configuration>
</plugin>
</plugins>
<defaultGoal>generate-resources asciidoctor:process-asciidoc</defaultGoal>
</build>
</profile>

</profiles>

</project>
2 changes: 1 addition & 1 deletion kubernetes-maven-plugin/plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<description>Kubernetes Maven Plugin</description>

<properties>
<jkube.kit.version>0.1-SNAPSHOT</jkube.kit.version>
<jkube.kit.version>${project.version}</jkube.kit.version>
<maven-plugin-api.version>3.5.4</maven-plugin-api.version>
<maven-plugin-annotation.version>3.5.2</maven-plugin-annotation.version>
<maven-plugin-plugin.version>3.5</maven-plugin-plugin.version>
Expand Down
Loading

0 comments on commit 084ebeb

Please sign in to comment.