This repository was archived by the owner on May 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Snapshot for standalone planner UI #2426
Closed
pranavgore09
wants to merge
31
commits into
fabric8-ui:master
from
pranavgore09:standalone-plannerUI-snapshot
Closed
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
81c2076
added new stages in release.groovy for building and pushing standalon…
pranavgore09 c2ecced
Merge remote-tracking branch 'upstream/master' into standalone-planne…
pranavgore09 4fe072e
Merge remote-tracking branch 'upstream/master' into standalone-planne…
pranavgore09 81b5cd4
ignore runtime/node_modules while building image for standalone plann…
pranavgore09 c4c83cc
Merge remote-tracking branch 'upstream/master' into standalone-planne…
pranavgore09 c1fda0c
Merge remote-tracking branch 'upstream/master' into standalone-planne…
pranavgore09 8fc8d3f
increase timeout to let the build get more time to run.
pranavgore09 f4f818c
added deployments in openshift
pranavgore09 7aeebd0
update YAML path to download
pranavgore09 80575e1
update commit message
pranavgore09 8d3e25a
no need to add TAG in original image name
pranavgore09 388d655
use default and add IMAGE_TAG later
pranavgore09 a282f3b
update environment
pranavgore09 e1c90ef
remove maintainer
pranavgore09 86a1d7c
bake ENV into the image
pranavgore09 3132ef2
remove config file and use original image name
pranavgore09 f850964
ignore fabric8-ui added in jenkins while docker build.
pranavgore09 0be09ea
build essential stages only
pranavgore09 c13e215
perform npm inside container('ui')
pranavgore09 cc76762
separate ENV vars from planner and K8S
pranavgore09 fc910c6
remove config
pranavgore09 932fb6f
resume older stages
pranavgore09 e2348f6
Merge remote-tracking branch 'upstream/master' into standalone-planne…
pranavgore09 030cc2e
Merge remote-tracking branch 'upstream/master' into standalone-planne…
pranavgore09 cbfdc5a
Merge remote-tracking branch 'upstream/master' into standalone-planne…
pranavgore09 c5da551
Merge branch 'master' into standalone-plannerUI-snapshot
nimishamukherjee 9c38eb7
Merge remote-tracking branch 'upstream/master' into standalone-planne…
pranavgore09 1131f68
Merge branch 'standalone-plannerUI-snapshot' of github.com:pranavgore…
pranavgore09 f7a21f2
Merge branch 'master' into standalone-plannerUI-snapshot
pranavgore09 0ae5da9
Merge remote-tracking branch 'upstream/master' into standalone-planne…
pranavgore09 caa661c
Merge remote-tracking branch 'upstream/master' into standalone-planne…
pranavgore09 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,3 +1,5 @@ | ||
| node_modules | ||
| *~ | ||
| *.swp | ||
| runtime/node_modules | ||
| fabric8-ui |
This file contains hidden or 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,11 @@ | ||
| FROM fabric8/fabric8-openshift-nginx:vd83b3a1 | ||
|
|
||
| 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} |
This file contains hidden or 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,10 +1,11 @@ | ||
| @Library('github.com/fabric8io/fabric8-pipeline-library@master') | ||
| @Library('github.com/pranavgore09/fabric8-pipeline-library@standalone-planner') | ||
| 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() | ||
|
|
@@ -27,9 +28,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" | ||
|
|
@@ -65,10 +69,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: 50, unit: 'MINUTES') { | ||
|
Collaborator
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. 50 minutes sounds pretty long.
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. yeah I understand but sometimes even 1h is less, In best case 10m is sufficient but current builds may take more time and timeout with a small timeout value. |
||
| def prj = 'fabric8-ui-'+ env.BRANCH_NAME | ||
| prj = prj.toLowerCase() | ||
| def route | ||
| deployOpenShiftNode(openshiftConfigSecretName: 'fabric8-intcluster-config'){ | ||
| stage("deploy ${prj}"){ | ||
| route = deployOpenShiftSnapshot{ | ||
|
|
@@ -95,5 +99,33 @@ if (ciDeploy){ | |
| } | ||
| } | ||
| } | ||
| prj = 'f8-plan-std'+ 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-plannerUI-snapshot/openshift/fabric8-planner.app.yml' | ||
| originalImageName = 'fabric8/fabric8-planner' | ||
| 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} standalone planner UI is deployed and available for testing at http://${route}" | ||
| container('clients'){ | ||
| flow.addCommentToPullRequest(message, pr, project) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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
This file contains hidden or 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,161 @@ | ||
| apiVersion: v1 | ||
| kind: Template | ||
| metadata: | ||
| name: f8planner | ||
| creationTimestamp: null | ||
| objects: | ||
| - apiVersion: v1 | ||
| kind: DeploymentConfig | ||
| metadata: | ||
| creationTimestamp: null | ||
| generation: 1 | ||
| labels: | ||
| service: f8planner | ||
| app: fabric8-planner | ||
| provider: fabric8 | ||
| name: f8planner | ||
| spec: | ||
| replicas: 3 | ||
| selector: | ||
| service: f8planner | ||
| strategy: | ||
| resources: {} | ||
| rollingParams: | ||
| intervalSeconds: 1 | ||
| maxSurge: 25% | ||
| maxUnavailable: 25% | ||
| timeoutSeconds: 600 | ||
| updatePeriodSeconds: 1 | ||
| type: Rolling | ||
| template: | ||
| metadata: | ||
| creationTimestamp: null | ||
| labels: | ||
| service: f8planner | ||
| app: fabric8-planner | ||
| provider: fabric8 | ||
| spec: | ||
| containers: | ||
| - image: fabric8/fabric8-planner:standalone | ||
| imagePullPolicy: Always | ||
| name: f8planner | ||
| ports: | ||
| - containerPort: 80 | ||
| protocol: TCP | ||
| env: | ||
| - name: WS_K8S_API_SERVER | ||
| value: ${WS_K8S_API_SERVER} | ||
| - name: K8S_API_SERVER_PROTOCOL | ||
| value: ${K8S_API_SERVER_PROTOCOL} | ||
| - name: K8S_API_SERVER_BASE_PATH | ||
| value: ${K8S_API_SERVER_BASE_PATH} | ||
| - name: OAUTH_ISSUER | ||
| value: ${OAUTH_ISSUER} | ||
| - name: OAUTH_CLIENT_ID | ||
| value: ${OAUTH_CLIENT_ID} | ||
| - name: OAUTH_SCOPE | ||
| value: ${OAUTH_SCOPE} | ||
| - name: OAUTH_AUTHORIZE_URI | ||
| value: ${OAUTH_AUTHORIZE_URI} | ||
| - name: AUTH_LOGOUT_URI | ||
| value: ${AUTH_LOGOUT_URI} | ||
| - name: FABRIC8_PIPELINES_NAMESPACE | ||
| value: ${FABRIC8_PIPELINES_NAMESPACE} | ||
| - name: PROXIED_K8S_API_SERVER | ||
| value: ${PROXIED_K8S_API_SERVER} | ||
| - name: PROXY_PASS_URL | ||
| value: ${PROXY_PASS_URL} | ||
| - name: FABRIC8_RECOMMENDER_API_URL | ||
| value: ${FABRIC8_RECOMMENDER_API_URL} | ||
| - name: FABRIC8_FORGE_API_URL | ||
| value: ${FABRIC8_FORGE_API_URL} | ||
| - name: OPENSHIFT_CONSOLE_URL | ||
| value: ${OPENSHIFT_CONSOLE_URL} | ||
| resources: {} | ||
| terminationMessagePath: /dev/termination-log | ||
| readinessProbe: | ||
| tcpSocket: | ||
| port: 8080 | ||
| initialDelaySeconds: 20 | ||
| timeoutSeconds: 10 | ||
| livenessProbe: | ||
| tcpSocket: | ||
| port: 8080 | ||
| initialDelaySeconds: 120 | ||
| timeoutSeconds: 10 | ||
| dnsPolicy: ClusterFirst | ||
| restartPolicy: Always | ||
| securityContext: {} | ||
| terminationGracePeriodSeconds: 30 | ||
| test: false | ||
| triggers: | ||
| - type: ConfigChange | ||
| status: {} | ||
| - apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| creationTimestamp: null | ||
| labels: | ||
| service: f8planner | ||
| app: fabric8-planner | ||
| provider: fabric8 | ||
| name: f8planner | ||
| spec: | ||
| ports: | ||
| - name: "8080" | ||
| port: 8080 | ||
| protocol: TCP | ||
| targetPort: 8080 | ||
| selector: | ||
| service: f8planner | ||
| sessionAffinity: None | ||
| type: ClusterIP | ||
| status: | ||
| loadBalancer: {} | ||
| - apiVersion: v1 | ||
| kind: Route | ||
| metadata: | ||
| creationTimestamp: null | ||
| labels: | ||
| service: f8planner | ||
| app: fabric8-planner | ||
| provider: fabric8 | ||
| name: fabric8-planner | ||
| spec: | ||
| host: '' | ||
| port: | ||
| targetPort: "8080" | ||
| to: | ||
| kind: Service | ||
| name: f8planner | ||
| weight: 100 | ||
| wildcardPolicy: None | ||
| status: {} | ||
| parameters: | ||
| - name: WS_K8S_API_SERVER | ||
| value: api.free-int.openshift.com:443 | ||
| - name: K8S_API_SERVER_PROTOCOL | ||
| value: https | ||
| - name: K8S_API_SERVER_BASE_PATH | ||
| value: /_p/oso | ||
| - name: OAUTH_ISSUER | ||
| value: https://api.free-int.openshift.com:443 | ||
| - name: OAUTH_CLIENT_ID | ||
| value: fabric8 | ||
| - name: OAUTH_SCOPE | ||
| value: user:full | ||
| - name: OAUTH_AUTHORIZE_URI | ||
| value: https://api.free-int.openshift.com:443/oauth/authorize | ||
| - name: AUTH_LOGOUT_URI | ||
| value: https://api.free-int.openshift.com:443/connect/endsession?id_token={{id_token}} | ||
| - name: FABRIC8_PIPELINES_NAMESPACE | ||
| - name: PROXY_PASS_URL | ||
| value: https://api.free-int.openshift.com:443 | ||
| - name: OPENSHIFT_CONSOLE_URL | ||
| value: https://console.free-int.openshift.com/console/ | ||
| - name: PROXIED_K8S_API_SERVER | ||
| value: api.free-int.openshift.com:443 | ||
| - name: FABRIC8_RECOMMENDER_API_URL | ||
| value: https://api-bayesian.dev.rdu2c.fabric8.io/api/v1/ | ||
| - name: FABRIC8_FORGE_API_URL | ||
| value: https://forge.api.prod-preview.openshift.io |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If you're using some custom code, send PR to main repo and switch the DIFF back.
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.
done fabric8io/fabric8-pipeline-library#378