• R/O
  • HTTP
  • SSH
  • HTTPS

grid-chef-repo: コミット

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


コミットメタ情報

リビジョン3aa58a0e9f07946ff9df01b19d281c4f30c75103 (tree)
日時2018-05-06 12:15:35
作者whitestar <whitestar@user...>
コミッターwhitestar

ログメッセージ

improves the utility scripts.

変更サマリ

差分

--- 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.9
5+-----
6+- improves the utility scripts.
7+
48 0.2.8
59 -----
610 - adds the `concourse_start` script.
--- a/cookbooks/concourse-ci/templates/default/opt/docker-compose/app/concourse/bin/concourse_import_ca
+++ b/cookbooks/concourse-ci/templates/default/opt/docker-compose/app/concourse/bin/concourse_import_ca
@@ -1,12 +1,12 @@
1-#!/bin/sh
2-
3-<%
4-node['concourse-ci']['ssl_cert']['ca_names'].each {|ca_name|
5--%>
6-if ! cat /etc/ca-certificates.conf | grep <%= ca_name %>; then
7- echo <%= ca_name %>.crt >> /etc/ca-certificates.conf
8-fi
9-<%
10-}
11--%>
12-update-ca-certificates
1+#!/bin/sh
2+
3+<%
4+node['concourse-ci']['ssl_cert']['ca_names'].each {|ca_name|
5+-%>
6+if ! cat /etc/ca-certificates.conf | grep <%= ca_name %>; then
7+ echo <%= ca_name %>.crt >> /etc/ca-certificates.conf
8+fi
9+<%
10+}
11+-%>
12+update-ca-certificates
--- a/cookbooks/concourse-ci/templates/default/opt/docker-compose/app/concourse/bin/concourse_start
+++ b/cookbooks/concourse-ci/templates/default/opt/docker-compose/app/concourse/bin/concourse_start
@@ -1,17 +1,23 @@
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.'
1+#!/bin/sh
2+
3+PATH=/usr/bin:/bin:/usr/local/bin
4+OPTS=''
5+
6+if [ `whoami` != 'root' ]; then
7+ echo 'ERROR: This script requires the root privilege.' >&2
8+ exit 1
9+fi
10+
11+if ! tty -s; then
12+ echo `date '+%Y-%m-%d %H:%M:%S %z'`' Starting Concourse ...'
13+ OPTS='--no-ansi'
14+fi
15+
16+cd <%= node['concourse-ci']['docker-compose']['app_dir'] %> && \
17+docker-compose $OPTS down && \
18+docker-compose $OPTS up -d && \
19+./bin/fly_prune_workers_main
20+
21+if ! tty -s; then
22+ echo `date '+%Y-%m-%d %H:%M:%S %z'`' Started Concourse.'
23+fi
--- a/cookbooks/concourse-ci/templates/default/opt/docker-compose/app/concourse/bin/concourse_up
+++ b/cookbooks/concourse-ci/templates/default/opt/docker-compose/app/concourse/bin/concourse_up
@@ -1,8 +1,8 @@
1-#!/bin/sh
2-# DEPRECATED: use `sudo docker-compose up` instead.
3-
4-cd <%= node['concourse-ci']['docker-compose']['app_dir'] %>
5-sudo docker-compose up -d
6-<% if node['concourse-ci']['docker-compose']['import_ca'] %>
7-sudo docker exec $(sudo docker ps | grep "concourse_concourse-web" | awk '{print $1}') concourse_import_ca
8-<% end %>
1+#!/bin/sh
2+# DEPRECATED: use `sudo docker-compose up` instead.
3+
4+cd <%= node['concourse-ci']['docker-compose']['app_dir'] %>
5+sudo docker-compose up -d
6+<% if node['concourse-ci']['docker-compose']['import_ca'] %>
7+sudo docker exec $(sudo docker ps | grep "concourse_concourse-web" | awk '{print $1}') concourse_import_ca
8+<% end %>
--- 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
@@ -5,7 +5,9 @@ PATH=.:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:`dirname $0`
55 MAX_RETRY=10
66 RETRY_INTERVAL=10
77
8-echo `date '+%Y-%m-%d %H:%M:%S %z'`' fly prune-workers ...'
8+if ! tty -s; then
9+ echo `date '+%Y-%m-%d %H:%M:%S %z'`' fly prune-workers ...'
10+fi
911
1012 if [ `whoami` != 'root' ]; then
1113 echo 'ERROR: This script requires the root privilege.' >&2
@@ -17,17 +19,16 @@ fi
1719 for num in `seq 0 ${MAX_RETRY}`; do
1820 if [ $num != 0 ]; then
1921 echo "Retrying ${num}/${MAX_RETRY}..."
22+ sleep ${RETRY_INTERVAL}s
2023 fi
2124 fly login -t main -u <%= @basic_auth_username %> -p $CONCOURSE_BASIC_AUTH_PASSWORD -c <%= @external_url %>
2225
2326 if [ $? -eq 0 ]; then
2427 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
28+ fi
29+ if [ $num = $MAX_RETRY ]; then
30+ echo 'ERROR: Concourse server connection refused.' >&2
31+ exit 1
3132 fi
3233 done
3334
--- a/cookbooks/concourse-ci/version
+++ b/cookbooks/concourse-ci/version
@@ -1 +1 @@
1-0.2.8
1+0.2.9
旧リポジトリブラウザで表示