# 2021/05/04 Concourse CI 幼幼班 https://ci.concourse-ci.org/ 可以先到官方的網站上面參觀瀏覽一下,下面會在自己的機器上面架設出一樣的東西。 請先準備好 docker 跟 docker-compose 與確認可以正常執行 `$ docker run hello-world` > p.s. concourse-demo 中使用到的 vault 好像不支援 rootless docker 請別使用 rootless docker > 在 Ubuntu 20.04 LTS 裡面,可以執行 `$ snap install docker` 或是 `$ sudo apt install docker.io docker-compose` 來安裝 其它作業系統請參考 https://docs.docker.com/engine/install/ 與 https://docs.docker.com/compose/install/ 來安裝。 Concourse CI 的幾個先天限制 * 只支援 Docker container * 只支援 amd64/x86_64 架構 * pipeline 不支援 if else 分支 * 要會寫 YAML * 學習曲線高 ([官方自己說的](https://concourse-ci.org/docs.html)) 先將 Concourse CI demo 跑起來 ```shell=bash $ git clone https://github.com/fourdollars/concourse-demo.git $ cd concourse-demo $ docker-compose pull $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE vault latest fd2a304f26b7 8 days ago 204MB registry 2 1fd8e1b0bb7e 2 weeks ago 26.2MB concourse/concourse 7.2.0 bee03b4ac00e 2 weeks ago 1.07GB postgres latest 26c8bcd8b719 2 weeks ago 314MB $ docker-compose up -d # 這步驟會下載超過 1GB 的資料,最好先在網路通暢的地方先跑過。 $ docker-compose ps -a # 檢查一下是不是都正常執行起來 Name Command State Ports ------------------------------------------------------------------------------------------------------------------- concourse-demo_db_1 docker-entrypoint.sh postgres Up 5432/tcp concourse-demo_registry_1 /entrypoint.sh /etc/docker ... Up 0.0.0.0:5000->5000/tcp concourse-demo_vault_1 docker-entrypoint.sh server Up 0.0.0.0:8200->8200/tcp concourse-demo_web_1 dumb-init /usr/local/bin/e ... Up 0.0.0.0:8080->8080/tcp, 0.0.0.0:8081->8081/tcp concourse-demo_worker_1 dumb-init /usr/local/bin/e ... Up ``` --- ## tutorial-1 跑完 tutorial-1 ~/.flyrc 中的 targets.demo.token.type 之所以為 bearer 的原因是因為它使用了 [HTTP OAuth 2.0 協議的 Bearer Token 身份驗證方式](https://tools.ietf.org/html/rfc6750),語意上是「給這個<ruby>象徵物<rp>(</rp><rt>token</rt><rp>)</rp></ruby>的<ruby>持有者<rp>(</rp><rt>bearer</rt><rp>)</rp></ruby>權限」的意思: > **Bearer authentication** (also called **token authentication**) is an [HTTP authentication scheme](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication) that involves security tokens called bearer tokens. The name “Bearer authentication” can be understood as “give access to the bearer of this token.” > > -- 摘錄自 [Bearer Authentication](https://swagger.io/docs/specification/authentication/bearer-authentication/) ## tutorial-8 * Concourse CI 最熱門的功能 * 可以作到所謂的 GitOps 的效果
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up