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 0ad6d1d commit d86c060
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
41 changes: 41 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/groovy
@Library('github.com/fabric8io/fabric8-pipeline-library@master')
def utils = new io.fabric8.Utils()
def org = 'fabric8-ui'
def repo = 'ngx-fabric8-wit'
fabric8UITemplate{
clientsNode{
ws {
git "https://github.com/${org}/${repo}.git"
readTrusted 'release.groovy'
sh "git remote set-url origin [email protected]:${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()
}

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){
echo 'we would Update Downstream Projects'
pushPackageJSONChangePR{
propertyName = 'ngx-fabric8-wit'
projects = [
'fabric8io/fabric8-ui'
]
version = v
}
}
return this

0 comments on commit d86c060

Please sign in to comment.