{"id":18045391,"url":"https://github.com/lance/pipeline-webapp-example","last_synced_at":"2025-09-07T06:36:12.929Z","repository":{"id":39458518,"uuid":"198296712","full_name":"lance/pipeline-webapp-example","owner":"lance","description":"Simple React.js application deployed using OpenShift Pipelines and running as a Knative Service","archived":false,"fork":false,"pushed_at":"2023-01-04T05:05:57.000Z","size":6780,"stargazers_count":2,"open_issues_count":22,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-07T06:35:53.379Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-22T20:23:35.000Z","updated_at":"2020-02-27T13:25:50.000Z","dependencies_parsed_at":"2023-02-01T22:16:55.212Z","dependency_job_id":null,"html_url":"https://github.com/lance/pipeline-webapp-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lance/pipeline-webapp-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lance%2Fpipeline-webapp-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lance%2Fpipeline-webapp-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lance%2Fpipeline-webapp-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lance%2Fpipeline-webapp-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lance","download_url":"https://codeload.github.com/lance/pipeline-webapp-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lance%2Fpipeline-webapp-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274005334,"owners_count":25205934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-30T18:13:03.111Z","updated_at":"2025-09-07T06:36:12.895Z","avatar_url":"https://github.com/lance.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploying a React Web App with Tekton Pipelines\n\nThis repository contains a simple, generated React.js application,\nand a bunch of YAML files to set up test and production deployment\npipelines, along with a [Knative Service](https://knative.dev/docs/serving/).\n\n## Web Application\n\nThe web application in `src` is just a generated React.js application\nwith a single added `script`.\n\n```json\n\"deploy:test\": \"nodeshift build --dockerImage=nodeshift/centos7-s2i-web-app --imageTag=10.x\"\n```\n\nThis script uses the [`nodeshift`](https://github.com/nodeshift/nodeshift) module\nto create an [`s2i`](https://github.com/openshift/source-to-image) binary build,\nresulting in an OpenShift `ImageStream`.\n\nTo run the application locally, from the `src` directory run `npm install \u0026\u0026 npm start`.\nIn test and production, the application is served via nginx.\n\n## Deployment Pipelines\n\nWe use a single parameterized Tekton `Pipeline` to deploy the application images to\nboth test and production. A Knative `Service` runs and scales the image and creates\na `Route` to it.\n\n## Deploying the `Pipeline`, `Task` and `Resource` Objects \n\nThe deployment pipelines require a privileged service account. To set this up, be sure\nyou are logged into an openshift instance with admin privileges and execute the\n`setup-service-account.sh` script. Now you are ready to install and configure the\nKubernetes objects that comprise the `Pipeline` and `Service`.\n\n* Create the service account and grant it privileges\n    * `./setup-service-account.sh`\n* Install the pipeline\n    * `oc apply -f deploy/webapp-pipeline.yaml`\n* Install the tasks\n    * `oc apply -f deploy/task/s2i.yaml`\n    * `oc apply -f deploy/task/openshift-client-task.yaml`\n    * `oc apply -f deploy/task/webapp-build-runtime-task.yaml`\n* Install the test deployment `Resource`s\n    * `oc apply -f deploy/test/webapp-test-build-resource.yaml`\n    * `oc apply -f deploy/test/webapp-test-runtime-resource.yaml`\n* Install the production deployment `Resource`s\n    * `oc apply -f deploy/production/webapp-prod-build-resource.yaml`\n    * `oc apply -f deploy/production/webapp-prod-runtime-resource.yaml`\n\n## Running the Pipeline Build\n\nThe pipeline for this application assumes that there is an existing image that\ncontains the built HTML, CSS and JavaScript files. This image is started and\nthe files are copied to a new image with nginx configured and run at startup. \n\n### Test Deployment\n\nFor the test workflow, the build image comes from the `deploy:test` script in\nthe web application's package.json file. To deploy this image run the script.\n\n```sh\nnpm run deploy:test\n```\n\nOnce the build image has been created, you can run the pipeline to generate\nthe nginx runtime image.\n\n```sh\noc apply -f deploy/test/webapp-test-pipeline-run.yaml\n```\n\n### Production Deployment\n\nFor the production workflow, we assume that we don't want an image that has been\ncreated by running nodeshift on a developer's computer. Instead, we want to use\nthe committed source in the GitHub repository, and run an `s2i` build on it use\nthe `s2i` `Task` we installed earlier. To do this, apply the `TaskRun` script.\n\n```sh\noc apply -f deploy/production/webapp-prod-build-taskrun.yaml\n```\n\nThis will create an image containing the static files that will be copied to a\nnew nginx image for runtime. To create the runtime image, execute the production\npipeline by applying the `PipelineRun` object.\n\n```sh\noc apply -f deploy/production/webapp-prod-pipeline-run.yaml\n```\n\n## Starting the Knative Service\n\nThe Knative `Service` sets up networking (routes/ingress) for the application\nand ensures there are sufficient replicas of the running container. To deploy\nthe `Service` run the following.\n\n```sh\noc apply -f deploy/production/production-service.yaml\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flance%2Fpipeline-webapp-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flance%2Fpipeline-webapp-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flance%2Fpipeline-webapp-example/lists"}