This repository has been archived by the owner on May 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update pipeline to build, test, release and publish to npm befor…
…e updating downstream deps
- Loading branch information
1 parent
478850f
commit ebd88ce
Showing
2 changed files
with
78 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |