{"id":39076783,"url":"https://github.com/cloud-gov/pages-pipeline-tasks","last_synced_at":"2026-01-17T18:27:15.066Z","repository":{"id":243293679,"uuid":"812008605","full_name":"cloud-gov/pages-pipeline-tasks","owner":"cloud-gov","description":"Concourse common tasks for cloud.gov Pages","archived":false,"fork":false,"pushed_at":"2025-05-22T22:18:05.000Z","size":70,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-22T23:39:20.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloud-gov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-06-07T18:57:37.000Z","updated_at":"2025-04-03T16:02:38.000Z","dependencies_parsed_at":"2024-11-08T16:21:18.135Z","dependency_job_id":"d9abbeeb-9113-484e-9cb9-2aaba6e554fc","html_url":"https://github.com/cloud-gov/pages-pipeline-tasks","commit_stats":null,"previous_names":["cloud-gov/pages-pipeline-tasks"],"tags_count":0,"template":false,"template_full_name":"cloud-gov/.github","purl":"pkg:github/cloud-gov/pages-pipeline-tasks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-gov%2Fpages-pipeline-tasks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-gov%2Fpages-pipeline-tasks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-gov%2Fpages-pipeline-tasks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-gov%2Fpages-pipeline-tasks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloud-gov","download_url":"https://codeload.github.com/cloud-gov/pages-pipeline-tasks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-gov%2Fpages-pipeline-tasks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28515485,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T17:57:59.192Z","status":"ssl_error","status_checked_at":"2026-01-17T17:57:52.527Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-17T18:27:14.971Z","updated_at":"2026-01-17T18:27:15.041Z","avatar_url":"https://github.com/cloud-gov.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cloud.gov Pages common Concourse pipeline tasks\nThis repo contains the source for some common concourse-ci.org pipeline tasks and resources.\n\nTo include in your pipeline, define a resource named pipeline-tasks:\n\n```yml\nresources:\n\n...\n\n- name: pipeline-tasks\n  type: git\n  source:\n    uri: ((pipeline-tasks-git-url))\n    branch: main\n```\n\nMake pipeline-tasks-git-url available as a credential.\n\n## Task Usage\n\n### cancel-deployment\n\nCancels an in-progress cf deployment.\n- Required params: `CF_API`, `CF_ORG`, `CF_SPACE`, `CF_APP_NAME`\n- Required image: `general-task`\n\n```yml\ntask: cancel-deployment\nimage: general-task\nfile: src/ci/partials/cancel-deployment.yml\nparams:\n    CF_API: https://api.gov\n    CF_ORG: org\n    CF_SPACE: space\n    CF_APP_NAME: app\n```\n\n### get-app-env\n\nIt gets the env vars for a CF application and writes them to a `.env` file for consumption in the following task. This task expects the pipeline's source code to be aliased to `src` and will output the file to the root of the source code located at `$PWD/src/.env`.\n\n- Required params: `APP_ENV`, `CF_APP_NAME`, `$CF_ORG`, `$CF_SPACE`, `$CF_API`, `CF_USERNAME`, `CF_PASSWORD`\n- Required image: `general-task`\n\n```yml\ntask: get-app-env\nimage: general-task\nfile: pipeline-tasks/tasks/get-app-env.yml\nparams:\n  _: #@ template.replace(data.values.env_cf)\n  APP_ENV: ((deploy-env))\n  CF_APP_NAME: pages-((deploy-env))\n```\n\n### init\n\nAdds information for common resources and resource types to a partially filled-in pipeline.yml prior to setting. The resulting pipeline file will be at `compiled/set-pipeline.yml`\n- Required params: `PIPELINE_YML`\n- Required image: `general-task`\n\n```yml\ntask: init\nimage: general-task\nfile: pipeline-tasks/tasks/init.yml\nparams:\n    PIPELINE_YML: src/ci/pipeline.yml\n```\n\n### npm-audit\n\nRuns npm audit and defaults to fail task if there are any `high` findings or above.\n- Optional params: `NPM_AUDIT_LEVEL` defaults to `high`.\n  - Available options: `info`, `low`, `moderate`, `high`, `critical`, `none`\n- Required Image: `node`\n\n```yml\ntask: audit-dependencies\nimage: node\nfile: pipeline-tasks/partials/npm-audit.yml\n\n// OR\n\ntask: audit-dependencies\nimage: node\nfile: pipeline-tasks/partials/npm-audit.yml\nparams:\n    NPM_AUDIT_LEVEL: moderate\n```\n\n### restage\n\nRestage a cf application.\n- Required params: `CF_API`, `CF_ORG`, `CF_SPACE`, `CF_APP_NAME`\n- Required image: `general-task`\n\n```yml\ntask: restage\nimage: general-task\nfile: src/ci/partials/restage.yml\nparams:\n    CF_API: https://api.gov\n    CF_ORG: org\n    CF_SPACE: space\n    CF_APP_NAME: app\n```\n\n### run-command\n\nRuns the provided bash command from the `src` directory\n- Required params: `COMMAND`\n\n```yml\ntask: the-script\nimage: node\nfile: pipeline-tasks/partials/run-command.yml\nparams:\n    COMMAND: npm run the-script\n\n// OR\n\ntask: cat-file\nimage: general-task\nfile: pipeline-tasks/partials/run-command.yml\nparams:\n    COMMAND: cat some_file.txt\n```\n\n### boot\n\nAn alternative to `init` when using a single multi-env pipeline file.\n\nAdds information for common resources and resource types to a partially filled-in pipeline.yml prior to setting. The resulting pipeline file will be at `compiled/set-pipeline.yml`. The `ENV_OVERRIDE` value is passed as a data value (`data.values.env`) and is used to control boolean operators within the `pipeline.yml` file. When flying the pipeline manually it is supplied via `--data-value env=$ENV_OVERRIDE`. In the actual `pipeline.yml` file, it can be set to `((deploy-env))`\n- Required params: `ENV_OVERRIDE`\n- Required image: `general-task`\n\n```yml\ntask: init\nimage: general-task\nfile: pipeline-tasks/tasks/boot.yml\nparams:\n    ENV_OVERRIDE: ((deploy-env))\n```\n\n## Common Values\n\nThe following are common values that can be used to set environment varable for pipeline tasks to use. They can be added to tasks via the task's `params` key.\n\nYou specify the name of the data value in conjuction with ytt's `template.replace` function.\n\nIe. - Adding the predifined CF environment variables with some additional task specific env vars:\n\n```ytt\ntask: a-ci-task\nparams:\n    _: #@ template.replace(data.values.env_cf)\n    ADDITIONAL_ENV_X: env-x-value\n    ADDITIONAL_ENV_Y: env-y-value\n    ...\n```\n\n### Available Data Values\n\nThese variables are made available as [Data Values](https://carvel.dev/ytt/docs/v0.49.x/how-to-use-data-values/). They can be accessed in templates by including `#@ load(\"@ytt:data\", \"data\")` and then referencing the variable via `data.values.VARIABLE_NAME`\n\n- `env` is set to null by default. Pipelines which use the `boot` task will override this with the environment name.\n\n- `base` includes:\n\n  - `CF_API: https://api.fr.cloud.gov`\n  - `CF_ORG: gsa-18f-federalist`\n  - `CF_STACK: cflinuxfs4`\n\n- `env_cf` includes:\n\n  - `\u003c\u003c: *base`: (Every value from base)\n  - `CF_SPACE`: The app space\n  - `CF_USERNAME`: The cf space username\n  - `CF_PASSWORD`: The cf space password\n\n- `env_cf_build_tasks` includes:\n\n  - `\u003c\u003c: *base` (Every value from base)\n    - `CF_SPACE`: The redirect space\n    - `CF_USERNAME`: The cf space username\n    - `CF_PASSWORD`: The cf space password\n\n- `env_cf_redirects` includes:\n  `\u003c\u003c: *base` (Every value from base)\n  - `CF_SPACE`: The build task space\n  - `CF_USERNAME`: The cf space username\n  - `CF_PASSWORD`: The cf space password\n\n## ytt templating\n\nThe [init](#init) and [boot](#boot) tasks use [`ytt`](https://carvel.dev/ytt/) to \"compile\" a pipeline.yml file without all the necessary information. We do this to avoid repeating common elements across all repositories/pipelines. Templated information ([\"overlays\"](https://carvel.dev/ytt/docs/v0.49.x/ytt-overlays/), [\"functions](https://carvel.dev/ytt/docs/v0.49.x/lang-ref-def/), and [\"data values\"](https://carvel.dev/ytt/docs/v0.49.x/ytt-data-values/)) are available in the `overlay` and `common` directories.\n\n## Running locally\n\nIf you need to fly a pipeline from your local machine to set up a new pipeline or update an existing one that cannot be self-set, you can generate the proper fly pipeline by compiling it locally using ytt, the deployments' pipeline.yml and the Pages pipeline tasks configuration.\n\nHere is an example of compiling and flying a pipeline.\n\n```bash\n## cd into the directory of the pipeline you would like to compile and fly\n\n## Compile the pipeline using ytt, all of the related files with -f, and the ytt\n## Params:\n#### -f ./ci/pipeline.yml: The path to the pipeline file\n#### -f ~/Work/cloud-gov/pages-pipeline-tasks/overlays: Path to ytt overlays\n#### -f ~/Work/cloud-gov/pages-pipeline-tasks/common: Path to ytt common\n#### --data-value env=dev: Set the env data value to dev\n## *Note:\n#### This example assumes the pages-pipeline-tasks repository is in ~/Work/cloud-gov\n#### Update the base path to the directory containing this repo on your local machine\nytt -f ./ci/pipeline.yml -f ~/Work/cloud-gov/pages-pipeline-tasks/overlays -f ~/Work/cloud-gov/pages-pipeline-tasks/common --data-value env=dev \u003e temp-pipeline.yml\n\n## Set the pipeline for the dev deploy env\nfly -t pages sp -p $PIPELINE_NAME -c temp-pipeline.yml -i deploy-env=dev\n```\n\n## Deploying a new pipeline\n\nA pipeline and each of it's instances will only needed to be set once per instance to create the initial pipeline. After the pipelines are set, updates to the default branch will automatically set the pipeline. See the [`set_pipeline` step](https://concourse-ci.org/set-pipeline-step.html) for more information. First, a compiled pipeline file needs to be created with [`ytt`](https://carvel.dev/ytt/):\n\n```sh\n$ ytt -f ci/pipeline.yml -f ../pages-pipeline-tasks/overlays -f ../pages-pipeline-tasks/common --data-value env=$env \u003e pipeline-$env.yml\n```\nThen, the following command will use the fly CLI to set a pipeline instance:\n\n```bash\n$ fly -t \u003cConcourse CI Target Name\u003e set-pipeline -p \u003cpipeline-name\u003e \\\n  -c pipeline-\u003cenv\u003e.yml \\\n  -i deploy-env=\u003cenv\u003e\n```\n\nytt -f ci/pipeline.yml -f ../pages-pipeline-tasks/overlays -f ../pages-pipeline-tasks/common --data-value env=staging \u003e pipeline-staging.yml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloud-gov%2Fpages-pipeline-tasks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloud-gov%2Fpages-pipeline-tasks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloud-gov%2Fpages-pipeline-tasks/lists"}