Skip to content

Latest commit

 

History

History
84 lines (59 loc) · 2.87 KB

lab-1.md

File metadata and controls

84 lines (59 loc) · 2.87 KB

Lab 1: Setup your Environment

How to setup this lab

  1. Fork this repository in to your own github account

  2. Clone your fork of this repository locally.

    export GITHUB_USERNAME=<your_github_username>
    git clone git@github.com:$GITHUB_USERNAME/sw-concourse-training.git
  3. Edit the nginx_release/ci/settings.yml file to set your github username. These settings will be interpolated in to other files throughout the tutorial and save you some typing.

NOTE: This is also a common pattern used in managing more complicated pipelines.

  1. Rename set_env.sh.example to set_env.sh and fill in the information it asks for and then source the file.

    #!/usr/bin/env bash
    # These variables are fixed values that typically won't change
    export CONCOURSE_TEAM_NAME=${USER}
    export CONCOURSE_USERNAME=admin
    # These variables are provided by your instructor
    export CONCOURSE_PIPELINE_URL=<pipeline_url>
    export GITHUB_USERNAME=<github_username>
    export CONCOURSE_PASSWORD=<concourse_password>
  2. Source the file in to your shell.

    source set_env.sh 

Create Your First Release

  1. Create the the release, it will give output a tarball artifact in the nginx_release folder of this project.

    cd nginx_release
    mkdir releases
    bosh create-release --force --name=${GITHUB_USERNAME}-nginx --tarball releases/release.gz --timestamp-version 
  2. Commit your release and push it back up to your Github fork.

    git commit -am 'updated release for deployment'
    git push
  3. To install the fly command, visit ${CONCOURSE_URL} and get the URL from the lower right. On a shared lab-provided jumpbox the fly command will be pre-installed for you.

  4. Target your concourse pipeline.

    fly --target training   login --concourse-url $CONCOURSE_PIPELINE_URL -k  -n $CONCOURSE_TEAM_NAME  -u $CONCOURSE_USERNAME -p $CONCOURSE_PASSWORD

Then look at the ci/lab1.yml file.

  1. Now we'll merge those changes in to your pipeline.

    spruce merge ci/settings.yml ci/lab1.yml > ci/pipeline.yml
    fly -t training set-pipeline -c ci/pipeline.yml -p ${GITHUB_USERNAME}-pipeline

Login to the concourse WEB UI

  • Visit the pipeline URL https://${CONCOURSE_URL}
  • Log In with provided credentials
  • Find your pipeline on the Left of the interface
  • New pipelines start in a paused state, you can now run your pipeline

Unpause your Concourse Pipeline

To unpause your pipeline you'll run the command:

```bash
fly -t training unpause-pipeline -p ${GITHUB_USERNAME}-pipeline
```

Now click the (+) symbol in the Web UI, if you've done everything correctly the pipeline should process successfully. Once the pipeline turns green you can move on to Lab-2.