Using CheatSheets To Apply Best Practices

CheatSheet: Concourse

CheatSheet: Concourse

1.1 Concourse Advanced

Name Summary
fly set-pipeline run into “error: forbidden” Need to logout from both fly client (fly logout --all) and Concourse GUI. Link: GitHub
github-release resource cannot find old tag fly -t $target cr -r $pipeline-name/$resource-name -f tag:$tag Link
List team details for all targets fly -t $target teams -d, ~/.flyrc
Concourse UI runs into a blank page If pipeline has recursive dependencies, Concourse UI may have issue to run its javascript code
Split one pipeline yaml into small reusable pieces Not supported. An uncomfortable workaround: generating yaml with other tools. Link: GitHub
Add a readonly member to one team Not supported. Concourse only support authentication control, but not authorization control
Hijack to containers with a successful run Not supported. By design when task has passed, the container will be deleted
Reference concourse-tutorial, concourse-pipeline-samples

1.2 Concourse Resources & Examples

Name Summary
Hello world pipeline example: helloworld.yml
Pass output to input across different tasks example: tasks-output-input.yml
Trigger pipeline test every 5 minutes example: run-test-regularly.yml
git-resource example: example-git.yml
concourse-curl-resource: http download link example: url-download.yml
docker-image-resource: docker image  
gcs-resource: google bucket  
file-downloader-resource enable downloading pivotal product files and stemcells
PCF pipelines examples GitHub: pcf-pipelines


1.3 Concourse Containers

Name Summary
Login to container fly -t $target hijack -u $job_url
Run command without sudden exit nohup SOMECOMMAND &; tail -f nohup.out

1.4 Concourse Concepts

Name Summary
fly Pipelines are configured entirely via the fly. There is no GUI.
Targets Alias of Concourse endpoints
Resource Allow you to define inputs and outputs to jobs in a pipeline
Step: tags Use tag to match workers
bbl (bosh-bootloader) GitHub: bosh-bootloader
Reference Link: Concourse Concepts, Link:

1.5 Concourse Pipeline

Name Summary
List all authenticated end points fly targets Link: fly targets
Get fly version fly --version
fly login fly -t $target login -c $concourse_url -n $team_name
Get pipeline definition fly -t $target get-pipeline -p $job-name > job.yaml Link: fly-getpipeline
Update pipeline fly -t $target set-pipeline -p $pipeline_name -c pipeline.yml -l credentials.yml
Update pipeline fly -t $target set-pipeline -p $pipeline_name -c pipeline.yml -v env1=var1
Destroy pipeline fly -t $target destroy-pipeline -p $pipeline_name
Format pipeline fly format-pipeline -c pipeline.yml
Validate pipeline fly validate-pipeline -c pipeline.yml

1.6 Concourse Security

Name Summary
Fly login to the default main team fly -t $target login -n main -c $concourse_url
Fly login to a different team fly -t $target login -n $team_name -c $concourse_url
List all teams fly -t $target teams, fly -t $target teams -d
Fly logout all targets fly logout --all
Create a team fly -t $target set-team -n $team_name --allow-all-users
Destroy a team fly -t $target destroy-team --team-name $team_name
Grant Github team access fly -t $target set-team -n $team_name --github-org $my_org
Login to a team fly -t $target set-team -n $team_name
Fly conf file ~/.flyrc
Reference After login to the main team, you can update other teams. Link: Concourse Team

1.7 fly Online Usage

bash-3.2$ fly --help
error: Usage:
  fly [OPTIONS] <command>

Application Options:
  -t, --target=              Concourse target name
  -v, --version              Print the version of Fly and exit
      --verbose              Print API requests and responses
      --print-table-headers  Print table headers even for redirected output

Help Options:
  -h, --help                 Show this help message

Available commands:
  abort-build        Abort a build (aliases: ab)
  builds             List builds data (aliases: bs)
  check-resource     Check a resource (aliases: cr)
  checklist          Print a Checkfile of the given pipeline (aliases: cl)
  containers         Print the active containers (aliases: cs)
  destroy-pipeline   Destroy a pipeline (aliases: dp)
  destroy-team       Destroy a team and delete all of its data (aliases: dt)
  execute            Execute a one-off build using local bits (aliases: e)
  expose-pipeline    Make a pipeline publicly viewable (aliases: ep)
  format-pipeline    Format a pipeline config (aliases: fp)
  get-pipeline       Get a pipeline's current configuration (aliases: gp)
  help               Print this help message
  hide-pipeline      Hide a pipeline from the public (aliases: hp)
  hijack             Execute a command in a container (aliases: intercept, i)
  jobs               List the jobs in the pipelines (aliases: js)
  login              Authenticate with the target (aliases: l)
  logout             Release authentication with the target (aliases: o)
  order-pipelines    Orders pipelines (aliases: op)
  pause-job          Pause a job (aliases: pj)
  pause-pipeline     Pause a pipeline (aliases: pp)
  pause-resource     Pause a resource (aliases: pr)
  pipelines          List the configured pipelines (aliases: ps)
  prune-worker       Prune a stalled, landing, landed, or retiring worker (aliases: pw)
  rename-pipeline    Rename a pipeline (aliases: rp)
  rename-team        Rename a team (aliases: rt)
  set-pipeline       Create or update a pipeline's configuration (aliases: sp)
  set-team           Create or modify a team to have the given credentials (aliases: st)
  status             Login status
  sync               Download and replace the current fly from the target (aliases: s)
  targets            List saved targets (aliases: ts)
  teams              List the configured teams (aliases: t)
  trigger-job        Start a job in a pipeline (aliases: tj)
  unpause-job        Unpause a job (aliases: uj)
  unpause-pipeline   Un-pause a pipeline (aliases: up)
  unpause-resource   Unpause a resource (aliases: ur)
  validate-pipeline  Validate a pipeline config (aliases: vp)
  volumes            List the active volumes (aliases: vs)
  watch              Stream a build's output (aliases: w)
  workers            List the registered workers (aliases: ws)

1.8 fly set-pipeline Online Usage

> fly  set-pipeline --help
error: Usage:
  fly [OPTIONS] set-pipeline [set-pipeline-OPTIONS]

Application Options:
  -t, --target=                     Concourse target name
  -v, --version                     Print the version of Fly and exit
      --verbose                     Print API requests and responses
      --print-table-headers         Print table headers even for redirected output

Help Options:
  -h, --help                        Show this help message

[set-pipeline command options]
      -n, --non-interactive         Skips interactions, uses default values
          --no-color                Disable color output
          --check-creds             Validate credential variables against credential manager
      -p, --pipeline=               Pipeline to configure
      -c, --config=                 Pipeline configuration file
      -v, --var=[NAME=STRING]       Specify a string value to set for a variable in the pipeline
      -y, --yaml-var=[NAME=YAML]    Specify a YAML value to set for a variable in the pipeline
      -l, --load-vars-from=         Variable flag that can be used for filling in template values in configuration from a YAML file

Leave a Reply

Your email address will not be published. Required fields are marked *