First Steps with Concourse¶
In this lab you will familiarize yourself with Concourse by:
- logging in to the Concourse dashboard
- logging in to Concourse via the
fly
cli - setting your first Concourse pipeline and running it
The Concourse Dashboard¶
In a browser, visit Concourse. The url follows the pattern ci.environment-name.pal4pe.com .
Locate local user credentials¶
We will discuss Credhub in detail in an upcoming lab.
For now, follow these instructions:
- Navigate to
~/workspace/concourse-bosh-deployment
-
Execute
credhub find --name-like=local
This command outputs the complete name (think key) of the credentials we are after. 1. Execute
credhub get --name=/p-bosh/concourse/local_user
Use these credentials to log in to the dashboard.
Notice the welcome message, and the fact that the team called main has no pipelines set at this time.
Log in via CLI¶
You installed fly
a few labs ago.
-
Verify that fly is indeed available in your path:
fly --version
For targeting a running Concourse server, fly has the concept of targets.
-
Invoke the command:
fly targets
No targets exist at this time. Notice how a target has a name, url, and a team.
-
A target is created by logging in for the first time.
Invoke the command:
fly login --help
Can you figure out how to invoke the fly login
command to create a
target called main?
Hints:
- Use the flags
--target
--concourse-url
--username
--team-name
- Do not supply a password
- The general format is to place the target flag after
fly
but before the subcommandlogin
; the subcommand-specific flags go last.
If all goes well, the cli will direct you to open a link in the browser, copy a token to your clipboard, and paste it back into the prompt in the shell.
- Re-run
fly targets
and verify that you now have a target called main
Unlike the cf
cli, every fly
command requires a target. i.e. always
start a fly command with fly -t target-name
.
Familiarize yourself with fly
¶
Run the fly --help
command and make note of specific sub-commands that
are available.
Here are some of the commands you will use in this and upcoming labs:
- targets, login, login, status
- teams, set-team, get-team
- pipelines, set-pipeline, get-pipeline
- trigger-job, hijack
- pause-pipeline, unpause-pipeline
Run the command-specific help on some of these commands, and exercise some of them.
A simple pipeline¶
- In a browser head over to the concourse web site
- Click on the examples tab
- Select the Hello world pipeline
In ~/workspace
, create a new directory named pipelines
and navigate to
it.
Grab a copy of the pipeline configuration and save it to a file named
hello.yml
.
Can you figure out how to set the pipeline, unpause it, and trigger it with fly?
I recommend you invoke the trigger-job
command together with the
--watch
flag.
Keep your Concourse web dashboard open and pay attention to how the dashboard changes from its initial state (empty):
- after you set the pipeline
- after you unpause the pipeline
- after you trigger the job
Did the job pass? Can you see the output it generated?