• R/O
  • HTTP
  • SSH
  • HTTPS

grid-chef-repo: コミット

Grid環境構築用のChefリポジトリです。


コミットメタ情報

リビジョン112691a7cc426dd182a9111a07001a38d97b066c (tree)
日時2018-05-03 12:43:32
作者whitestar <whitestar@user...>
コミッターwhitestar

ログメッセージ

adds the concourse_start script.

変更サマリ

差分

--- a/cookbooks/concourse-ci/CHANGELOG.md
+++ b/cookbooks/concourse-ci/CHANGELOG.md
@@ -1,6 +1,10 @@
11 concourse-ci CHANGELOG
22 ======================
33
4+0.2.8
5+-----
6+- adds the `concourse_start` script.
7+
48 0.2.7
59 -----
610 - adds the `fly_prune_workers_main` script.
--- a/cookbooks/concourse-ci/recipes/docker-compose.rb
+++ b/cookbooks/concourse-ci/recipes/docker-compose.rb
@@ -310,10 +310,19 @@ template "#{bin_dir}/fly_prune_workers_main" do
310310 mode '0755'
311311 action :create
312312 variables(
313+ basic_auth_username: web_envs_org['CONCOURSE_BASIC_AUTH_USERNAME'],
313314 external_url: external_url
314315 )
315316 end
316317
318+template "#{bin_dir}/concourse_start" do
319+ source 'opt/docker-compose/app/concourse/bin/concourse_start'
320+ owner 'root'
321+ group 'root'
322+ mode '0755'
323+ action :create
324+end
325+
317326 log <<-"EOM"
318327 Note: You must execute the following command manually.
319328 See #{doc_url}
--- /dev/null
+++ b/cookbooks/concourse-ci/templates/default/opt/docker-compose/app/concourse/bin/concourse_start
@@ -0,0 +1,17 @@
1+#!/bin/sh
2+
3+PATH=/usr/bin:/bin:/usr/local/bin
4+
5+if [ `whoami` != 'root' ]; then
6+ echo 'ERROR: This script requires the root privilege.' >&2
7+ exit 1
8+fi
9+
10+echo `date '+%Y-%m-%d %H:%M:%S %z'`' Starting Concourse ...'
11+
12+cd <%= node['concourse-ci']['docker-compose']['app_dir'] %> && \
13+docker-compose down && \
14+docker-compose up -d && \
15+./bin/fly_prune_workers_main
16+
17+echo `date '+%Y-%m-%d %H:%M:%S %z'`' Started Concourse.'
--- a/cookbooks/concourse-ci/templates/default/opt/docker-compose/app/concourse/bin/fly_prune_workers_main
+++ b/cookbooks/concourse-ci/templates/default/opt/docker-compose/app/concourse/bin/fly_prune_workers_main
@@ -1,13 +1,34 @@
1-#!/usr/bin/env bash
1+#!/bin/sh
22
33 PATH=.:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:`dirname $0`
44
5+MAX_RETRY=10
6+RETRY_INTERVAL=10
7+
8+echo `date '+%Y-%m-%d %H:%M:%S %z'`' fly prune-workers ...'
9+
510 if [ `whoami` != 'root' ]; then
6- echo 'ERROR: This script requires the root privilege.'
11+ echo 'ERROR: This script requires the root privilege.' >&2
712 exit 1
813 fi
914
1015 . <%= node['concourse-ci']['docker-compose']['app_dir'] %>/.env
1116
12-fly login -t main -u concourse -p $CONCOURSE_BASIC_AUTH_PASSWORD -c <%= @external_url %>
17+for num in `seq 0 ${MAX_RETRY}`; do
18+ if [ $num != 0 ]; then
19+ echo "Retrying ${num}/${MAX_RETRY}..."
20+ fi
21+ fly login -t main -u <%= @basic_auth_username %> -p $CONCOURSE_BASIC_AUTH_PASSWORD -c <%= @external_url %>
22+
23+ if [ $? -eq 0 ]; then
24+ break
25+ else
26+ if [ $num = $MAX_RETRY ]; then
27+ echo 'ERROR: Concourse server connection refused.' >&2
28+ exit 1
29+ fi
30+ sleep ${RETRY_INTERVAL}s
31+ fi
32+done
33+
1334 fly_prune_workers -t main
--- a/cookbooks/concourse-ci/version
+++ b/cookbooks/concourse-ci/version
@@ -1 +1 @@
1-0.2.7
1+0.2.8
旧リポジトリブラウザで表示