LoginSignup

This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

More than 5 years have passed since last update.

Concourse CIメモ

Posted at

はじめてのConcourse CI

hello.yml
jobs:
- name: hello-world
  plan:
  - task: say-hello
    config:
      platform: linux
      image_resource:
        type: docker-image
        source:
          repository: ubuntu
      run:
        path: bash
        args: 
        - -c
        - |
          echo "Hello, world!"

flyコマンド

基本構成

fly [OPTIONS] <command>

ログインする

# -t lite => http://192.168.100.4:8080のConcourseへのエイリアスになる
# そのためログイン移行はこのエイリアスを使用して対象のConcourseを指定する
fly -t lite login -c http://192.168.100.4:8080

パイプラインを登録にする

# -p hello => パイプライン名
# -c hello.yml => パイプラインの構成ファイル
fly -t lite set-pipeline -p hello -c hello.yml

Kobito.cUIQiv.png

パイプラインを削除する

# -p hello => パイプライン名
fly -t lite destroy-pipeline -p hello

パイプラインを有効にする

# -p hello => パイプライン名
fly -t lite unpause-pipeline -p hello

Kobito.CuOEPR.png

hello-worldジョブを実行

# -j hello/hello-world => 構成のyamlファイルの中のjob名を指定
# --watch => 実行内容をコンソールに出力(指定しなければ出力されない)
fly -t lite trigger-job -j hello/hello-world --watch

Kobito.tw31Vj.png
Kobito.iDRQac.png

output
started hello/hello-world #1

initializing
# ...

Successfully pulled ubuntu@sha256:dd7808d8792c9841d0b460122f1acf0a2dd1f56404f8d1e56298048885e45535.

running bash -c echo "Hello, world!"
Hello, world!
succeeded

One-Off Taskを実行する

  • Concouseには登録されないので、タスクの開発時などに使う
hello.yml
---
platform: linux
image_resource:
  type: docker-image
  source:
    repository: alpine
run:
  path: echo
  args: ["Hello", "World"]
# -c hello.yml => 実行ターゲットの
fly -t lite execute -c hello.yml
#

#

#

#

0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up