1、install docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo docker -v
Docker version 24.0.2, build cb74dfc
sudo containerd -v
containerd containerd.io 1.6.21 3dce8eb055cbb6872793272b4f20ed16117344f8
sudo docker-compose -v
docker-compose version 1.29.2, build unknown
2、install concourse ci
wget https://concourse-ci.org/docker-compose.yml
cat docker-compost.yml
version: '3'
services:
concourse-db:
image: postgres
environment:
POSTGRES_DB: concourse-db
POSTGRES_PASSWORD: concourse_pass #database connect pass
POSTGRES_USER: concourse_user #database connect user
PGDATA: /database
concourse:
image: concourse/concourse
command: quickstart
privileged: true
depends_on: [concourse-db]
ports: ["8080:8080"]
environment:
CONCOURSE_POSTGRES_HOST: concourse-db #database name
CONCOURSE_POSTGRES_USER: concourse_user #database connect user
CONCOURSE_POSTGRES_PASSWORD: concourse_pass #database connect pass
CONCOURSE_POSTGRES_DATABASE: concourse
CONCOURSE_EXTERNAL_URL: http://ip:8080 #concourse URL
CONCOURSE_ADD_LOCAL_USER: concourse-user:concourse-pass #account/passwd
CONCOURSE_MAIN_TEAM_LOCAL_USER: concourse #admin access
# instead of relying on the default "detect"
CONCOURSE_WORKER_BAGGAGECLAIM_DRIVER: overlay
CONCOURSE_CLIENT_SECRET: Y29uY291cnNlLXdlYgo=
CONCOURSE_TSA_CLIENT_SECRET: Y29uY291cnNlLXdvcmtlcgo=
CONCOURSE_X_FRAME_OPTIONS: allow
CONCOURSE_CONTENT_SECURITY_POLICY: "*"
CONCOURSE_CLUSTER_NAME: tutorial
CONCOURSE_WORKER_CONTAINERD_DNS_SERVER: "8.8.8.8"
# For ARM-based machine, change the Concourse runtime to "houdini"
CONCOURSE_WORKER_RUNTIME: "containerd"
sudo docker-compose up -d
Two contarnerd will be created
3、install fly
curl 'http://localhost:8080/api/v1/cli?arch=amd64&platform=linux' -o fly && chmod +x ./fly && mv ./fly /usr/local/bin/
sudo fly -v
替换成服务器ip
4、Creating a Pipeline
vim hello-world.yml
jobs:
- name: hello-world-job
plan:
- task: hello-world-task
config:
platform: linux
image_resource:
type: registry-image
source:
repository: busybox
run:
path: echo
args: ["Hello world!"]
常用命令
fly -t ci login -c http://localhost:8080 -u <concourse-user> -p <concourse-pass>
fly -t ci set-pipeline -p hello-world -c hello-world.yml
fly -t ci trigger-job --job hello-world/hello-world-job --watch
fly -t ci login -c http://
:8080 -u $USERNAME -p $USERPASS` -t ci 将后面的 登录信息,缩写成 ci,之后的调用中,用ci表示。可以创建新的,并不影响旧的使用(具体是能无限创建还是有有限创建还没有验证。)
fly -t ci set-pipeline -p hello-world -c hello-world.yml -p 为新创建的pipline 起一个名字。 -c 指定以哪个 config 为运行文件。 使用该命令会创建一个状态为挂起的 pipline。
标签:ci,concourse,CONCOURSE,world,docker,安装,hello From: https://www.cnblogs.com/guxiaobai/p/17769540.htmlfly -t ci trigger-job --job hello-world/hello-world-job --watch 此条命令表示运行并监控指定job的状态,当你在控制台点击状态改变的时候会有对应的输出。 hello-world 上一条命令为新pipline 起的名字。 hello-world-job yaml 文件内 job 的名字。 --watch 将过程和结果输出到终端。