From 56213bc1eca52d375a651497a3bc7085f230813b Mon Sep 17 00:00:00 2001 From: flacatus Date: Tue, 12 Jul 2022 12:59:00 +0200 Subject: [PATCH 1/2] fixes --- main.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index a2f375f..bccca23 100644 --- a/main.js +++ b/main.js @@ -4,11 +4,13 @@ const Users = require('./users'); const port = process.env.PORT || 8081 function handleGetReq(req, res) { - if (req.url !== '/users') { - return handleError(res, 404) - } res.setHeader('Content-Type', 'application/json;charset=utf-8'); - return res.end(JSON.stringify(Users.getUsers())) + if (req.url === '/') { + return res.end(`{"live": "ok"}`) + } else if (req.url === '/users') { + return res.end(JSON.stringify(Users.getUsers())) + } + return handleError(res, 404) } function handleError (res, code) { From 0c8d1e116d8e265cb31d56d17fb59d50dccd5ad2 Mon Sep 17 00:00:00 2001 From: redhat-appstudio Date: Mon, 19 Dec 2022 15:45:48 +0000 Subject: [PATCH 2/2] Appstudio update simple-nodejs-app-h201 --- .../simple-nodejs-app-h201-pull-request.yaml | 48 +++++++++++++++++++ .tekton/simple-nodejs-app-h201-push.yaml | 47 ++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 .tekton/simple-nodejs-app-h201-pull-request.yaml create mode 100644 .tekton/simple-nodejs-app-h201-push.yaml diff --git a/.tekton/simple-nodejs-app-h201-pull-request.yaml b/.tekton/simple-nodejs-app-h201-pull-request.yaml new file mode 100644 index 0000000..8e940d9 --- /dev/null +++ b/.tekton/simple-nodejs-app-h201-pull-request.yaml @@ -0,0 +1,48 @@ +apiVersion: tekton.dev/v1beta1 +kind: PipelineRun +metadata: + annotations: + build.appstudio.redhat.com/commit_sha: '{{revision}}' + build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}' + build.appstudio.redhat.com/target_branch: '{{target_branch}}' + pipelinesascode.tekton.dev/max-keep-runs: "3" + pipelinesascode.tekton.dev/on-event: '[pull_request]' + pipelinesascode.tekton.dev/on-target-branch: '[main,master]' + creationTimestamp: null + labels: + appstudio.openshift.io/application: test + appstudio.openshift.io/component: simple-nodejs-app-h201 + pipelines.appstudio.openshift.io/type: build + name: simple-nodejs-app-h201-on-pull-request + namespace: rsoaresd +spec: + params: + - name: git-url + value: '{{repo_url}}' + - name: revision + value: '{{revision}}' + - name: output-image + value: quay.io/redhat-appstudio/user-workload:on-pr-{{revision}} + - name: dockerfile + value: https://raw.githubusercontent.com/nodeshift-starters/devfile-sample/main/Dockerfile + - name: path-context + value: ./ + pipelineRef: + bundle: quay.io/redhat-appstudio/build-templates-bundle:13f5d9c921b3f727684a00084037f673a0dc4273 + name: docker-build + workspaces: + - name: workspace + volumeClaimTemplate: + metadata: + creationTimestamp: null + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + status: {} + - name: registry-auth + secret: + secretName: redhat-appstudio-registry-pull-secret +status: {} diff --git a/.tekton/simple-nodejs-app-h201-push.yaml b/.tekton/simple-nodejs-app-h201-push.yaml new file mode 100644 index 0000000..e70a975 --- /dev/null +++ b/.tekton/simple-nodejs-app-h201-push.yaml @@ -0,0 +1,47 @@ +apiVersion: tekton.dev/v1beta1 +kind: PipelineRun +metadata: + annotations: + build.appstudio.redhat.com/commit_sha: '{{revision}}' + build.appstudio.redhat.com/target_branch: '{{target_branch}}' + pipelinesascode.tekton.dev/max-keep-runs: "3" + pipelinesascode.tekton.dev/on-event: '[push]' + pipelinesascode.tekton.dev/on-target-branch: '[main,master]' + creationTimestamp: null + labels: + appstudio.openshift.io/application: test + appstudio.openshift.io/component: simple-nodejs-app-h201 + pipelines.appstudio.openshift.io/type: build + name: simple-nodejs-app-h201-on-push + namespace: rsoaresd +spec: + params: + - name: git-url + value: '{{repo_url}}' + - name: revision + value: '{{revision}}' + - name: output-image + value: quay.io/redhat-appstudio/user-workload:{{revision}} + - name: dockerfile + value: https://raw.githubusercontent.com/nodeshift-starters/devfile-sample/main/Dockerfile + - name: path-context + value: ./ + pipelineRef: + bundle: quay.io/redhat-appstudio/build-templates-bundle:13f5d9c921b3f727684a00084037f673a0dc4273 + name: docker-build + workspaces: + - name: workspace + volumeClaimTemplate: + metadata: + creationTimestamp: null + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + status: {} + - name: registry-auth + secret: + secretName: redhat-appstudio-registry-pull-secret +status: {}