Skip to content

Commit

Permalink
Merge pull request fabric8-updatebot#5 from jstrachan/malarkey
Browse files Browse the repository at this point in the history
getting ready for the new shiny pipeline stuff
  • Loading branch information
jstrachan authored Jan 30, 2018
2 parents d0df48c + f8c4bc3 commit e7835e4
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 6 deletions.
28 changes: 22 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
pipeline {
environment {
GH_CREDS = credentials('jenkins-x-github')
}
agent {
label "jenkins-maven"
}
stages {
stage('Maven Release') {
stage('CI Build') {
when {
branch 'PR-*'
}
steps {
checkout scm
container('maven') {
sh "mvn clean install"
}
}
}

stage('Build and Push Release') {
when {
branch 'master'
}
steps {
mavenFlow {
cdOrganisation "jenkins-x"
useStaging false
useSonatype true
pauseOnFailure true
checkout scm
container('maven') {
sh './jx/scripts/release.sh'
}
}
}
Expand Down
23 changes: 23 additions & 0 deletions jx/scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

# ensure we're not on a detached head
git checkout master

# until we switch to the new kubernetes / jenkins credential implementation use git credentials store
git config credential.helper store

# so we can retrieve the version in later steps
echo $(jx-release-version) > target/VERSION
mvn versions:set -DnewVersion=$(cat target/VERSION)

mvn clean -B
mvn -V -B -e -U install org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7:deploy -P release -P openshift -DnexusUrl=https://oss.sonatype.org -DserverId=oss-sonatype-staging

# now the sonatype repo ids will be on disk

#jx step nexus_release

#git commit -a -m 'release $(cat target/VERSION)'
#git push origin release-$(cat target/VERSION)


0 comments on commit e7835e4

Please sign in to comment.