Concourse

August 22, 2024 ยท View on GitHub

https://concourse-ci.org/

Nice simple lean open source CI/CD tool.

QuickStart in Docker in one command

In HariSekhon/DevOps-Bash-tools:

cicd/concourse.sh

uses adjacent config cicd/.concourse.yml

Boots Concourse CI in Docker, and builds the current repo

  • boots Concourse container in Docker
  • creates job pipeline from $PWD/.concourse.yml
  • unpauses pipeline and job
  • triggers pipeline job
  • follows job build log in CLI
  • prints recent build statuses

CLI

Install

In HariSekhon/DevOps-Bash-tools

Downloads latest release from GitHub:

install/install_fly.sh

Unfortunately no binaries available for new Apple Silicon arm64 Macs yet, see this issue which has been open for years.

fly.sh

Wraps fly command to:

  • auto-download the CLI from the Concourse server if not present
  • uses $FLY_TARGET environment if present to inject -t "$target" to save repetition of switches
cicd/fly.sh

fly

Auth

Generates Authorization bearer token in ~/.flyrc - curl needs to use this, cannot curl basic auth directly

fly login ...

To get whole curl command printed out including token header:

fly -t ci curl /api/v1/teams/main/cc.xml --print-and-exit

Usage

fly format-pipeline --config .concourse.yml --write
fly -t example get-pipeline --pipeline my-pipeline

List targets, URLs + auth status

fly targets

Show auth status to target

fly -t "$target" status

Who you are logged in as

fly -t "$target" userinfo

Replaces your fly CLI with the latest version from server:

fly -t "$target" sync

Fly shell auto-completion

source <(fly completion --shell bash)

or

fly completion --shell bash > /etc/bash_completion.d/fly

Concourse YAML

Environment variable:

((my_env_var))

Ported from private Knowledge Base page 2020+