Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
fix: update pipeline to build, test, release and publish to npm befor…
Browse files Browse the repository at this point in the history
…e updating downstream deps
  • Loading branch information
rawlingsj authored and joshuawilson committed Mar 15, 2017
1 parent 478850f commit ebd88ce
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 9 deletions.
37 changes: 28 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,41 @@
#!/usr/bin/groovy
@Library('github.com/fabric8io/fabric8-pipeline-library@master')
def utils = new io.fabric8.Utils()
clientsNode{
def org = 'fabric8-ui'
def repo = 'ngx-login-client'
fabric8UITemplate{
clientsNode{
ws {
checkout scm
git "https://github.com/${org}/${repo}.git"
readTrusted 'release.groovy'
sh "git remote set-url origin git@github.com:${org}/${repo}.git"
def pipeline = load 'release.groovy'

if (utils.isCI()){
container('ui'){
pipeline.ci()
}
} else if (utils.isCD()){
def branch
container('clients'){
branch = utils.getBranch()
}

def published
container('ui'){
published = pipeline.cd(branch)
}

def releaseVersion
container('clients'){
releaseVersion = utils.getLatestVersionFromTag()
}

pushPackageJSONChangePR{
propertyName = 'ngx-login-client'
projects = [
'fabric8-ui/ngx-fabric8-wit',
'fabric8io/fabric8-ui'
]
version = releaseVersion
if (published){
pipeline.updateDownstreamProjects(releaseVersion)
}
}
}
}
}

50 changes: 50 additions & 0 deletions release.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/groovy
def ci (){
stage('build'){
sh 'npm install'
}
stage('unit test'){
sh './run_unit_tests.sh'
}
stage('functional test'){
sh './run_functional_tests.sh'
}
}

def cd (b){
stage('fix git repo'){
sh './fix-git-repo.sh'
}

stage('build'){
sh 'npm install'
sh 'npm run build'
}

stage('unit test'){
sh './run_unit_tests.sh'
}

stage('functional test'){
sh './run_functional_tests.sh'
}

stage('release'){
def published = npmRelease{
branch = b
}
return published
}
}

def updateDownstreamProjects(v){
pushPackageJSONChangePR{
propertyName = 'ngx-login-client'
projects = [
'fabric8-ui/ngx-fabric8-wit',
'fabric8io/fabric8-ui'
]
version = v
}
}
return this

0 comments on commit ebd88ce

Please sign in to comment.