-
Notifications
You must be signed in to change notification settings - Fork 62
Snapshot for standalone planner UI #2426
Changes from 5 commits
81c2076
c2ecced
4fe072e
81b5cd4
c4c83cc
c1fda0c
8fc8d3f
f4f818c
7aeebd0
80575e1
8d3e25a
388d655
a282f3b
e1c90ef
86a1d7c
3132ef2
f850964
0be09ea
c13e215
cc76762
fc910c6
932fb6f
e2348f6
030cc2e
cbfdc5a
c5da551
9c38eb7
1131f68
f7a21f2
0ae5da9
caa661c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| node_modules | ||
| *~ | ||
| *.swp | ||
| runtime/node_modules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| FROM fabric8/fabric8-openshift-nginx:vd83b3a1 | ||
| MAINTAINER "Pete Muir <[email protected]>" | ||
|
|
||
| USER root | ||
|
|
||
| RUN rm -rf /usr/share/nginx/html/ | ||
| COPY ./runtime/dist /usr/share/nginx/html | ||
| RUN chmod -R 777 /var/lib/nginx/ | ||
| RUN chmod -R 777 /usr/share/nginx/html/ | ||
|
|
||
|
|
||
| USER ${FABRIC8_USER_NAME} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| @Library('github.com/fabric8io/fabric8-pipeline-library@master') | ||
| @Library('github.com/pranavgore09/fabric8-pipeline-library@standalone-planner') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you're using some custom code, send PR to main repo and switch the DIFF back.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| def utils = new io.fabric8.Utils() | ||
| def flow = new io.fabric8.Fabric8Commands() | ||
| def project = 'fabric8-ui/fabric8-planner' | ||
| def ciDeploy = false | ||
| def tempVersion | ||
| def imageName | ||
| def standaloneImageName | ||
| node{ | ||
| properties([ | ||
| disableConcurrentBuilds() | ||
|
|
@@ -31,9 +32,12 @@ fabric8UITemplate{ | |
| pipeline.buildImage(imageName) | ||
| } | ||
|
|
||
| standaloneImageName = "fabric8/fabric8-planner:${tempVersion}" | ||
| container('docker'){ | ||
| pipeline.getStandaloneImage(standaloneImageName) | ||
| } | ||
| ciDeploy = true | ||
|
|
||
|
|
||
| } else if (utils.isCD()){ | ||
| sh "git checkout master" | ||
| sh "git pull" | ||
|
|
@@ -69,10 +73,10 @@ fabric8UITemplate{ | |
|
|
||
| // deploy a snapshot fabric8-ui pod and notify pull request of details | ||
| if (ciDeploy){ | ||
| def prj = 'fabric8-ui-'+ env.BRANCH_NAME | ||
| prj = prj.toLowerCase() | ||
| def route | ||
| timeout(time: 10, unit: 'MINUTES') { | ||
| timeout(time: 10, unit: 'MINUTES') { | ||
| def prj = 'fabric8-ui-'+ env.BRANCH_NAME | ||
| prj = prj.toLowerCase() | ||
| def route | ||
| deployOpenShiftNode(openshiftConfigSecretName: 'fabric8-intcluster-config'){ | ||
| stage("deploy ${prj}"){ | ||
| route = deployOpenShiftSnapshot{ | ||
|
|
@@ -99,5 +103,34 @@ if (ciDeploy){ | |
| } | ||
| } | ||
| } | ||
| prj = 'fabric8-planner-standalone'+ env.BRANCH_NAME | ||
| prj = prj.toLowerCase() | ||
| deployOpenShiftNode(openshiftConfigSecretName: 'fabric8-intcluster-config'){ | ||
| stage("deploy ${prj}"){ | ||
| route = deployPlannerSnapshot{ | ||
| openShiftProject = prj | ||
| openShiftTemplate = 'https://raw.githubusercontent.com/pranavgore09/fabric8-planner/standalone-planner-cd/openshift/fabric8-planner.app.yml' | ||
| openShiftConfig = 'https://raw.githubusercontent.com/pranavgore09/fabric8-planner/standalone-planner-cd/openshift/config' | ||
| originalImageName = 'fabric8/fabric8-planner:${IMAGE_TAG}' | ||
| newImageName = standaloneImageName | ||
| githubRepo = 'fabric8-planner' | ||
| githubProject = project | ||
| } | ||
| } | ||
| stage("notify for ${prj}"){ | ||
| def changeAuthor = env.CHANGE_AUTHOR | ||
| if (!changeAuthor){ | ||
| error "no commit author found so cannot comment on PR" | ||
| } | ||
| def pr = env.CHANGE_ID | ||
| if (!pr){ | ||
| error "no pull request number found so cannot comment on PR" | ||
| } | ||
| def message = "@${changeAuthor} ${imageName} is deployed and available for testing at https://${route}" | ||
| container('clients'){ | ||
| flow.addCommentToPullRequest(message, pr, project) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,26 @@ def buildImage(imageName){ | |
| } | ||
| } | ||
|
|
||
| def getStandaloneImage(imageName){ | ||
| stage('build standalone npm') { | ||
| dir('runtime'){ | ||
| container('ui'){ | ||
| sh 'npm cache clean --force' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not required in a fresh environment, unless you have found a reason why it's needed.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @debloper I don't think the environment is fresh when we rebuild the PR. At times PR build fails due to npm |
||
| sh 'npm install' | ||
| sh 'npm run build' | ||
| } | ||
| } | ||
| } | ||
|
|
||
| stage('build standalone snapshot image'){ | ||
| sh "docker build -t ${imageName} -f ./Dockerfile.deploy.runtime ." | ||
| } | ||
|
|
||
| stage('push standalone snapshot image'){ | ||
| sh "docker push ${imageName}" | ||
| } | ||
| } | ||
|
|
||
| def cd (b){ | ||
| stage('fix git repo'){ | ||
| sh './scripts/fix-git-repo.sh' | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope.
He's not gonna maintain this. Either add your name or remove this line. :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, copy-paster error!
thanks, removed in e1c90ef