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 18
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
0ad6d1d
commit d86c060
Showing
2 changed files
with
91 additions
and
0 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 |
---|---|---|
@@ -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) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
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){ | ||
echo 'we would Update Downstream Projects' | ||
pushPackageJSONChangePR{ | ||
propertyName = 'ngx-fabric8-wit' | ||
projects = [ | ||
'fabric8io/fabric8-ui' | ||
] | ||
version = v | ||
} | ||
} | ||
return this |