From 325e252478c4df4fb3197b7fd7a4de12fbd45ab2 Mon Sep 17 00:00:00 2001 From: whitestar Date: Sun, 12 Aug 2018 10:27:29 +0900 Subject: [PATCH] add the screwdriver-all-on-docker role. --- nodes/local-screwdriver-all-on-docker.json | 5 ++ roles/screwdriver-all-on-docker.rb | 105 +++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 nodes/local-screwdriver-all-on-docker.json create mode 100644 roles/screwdriver-all-on-docker.rb diff --git a/nodes/local-screwdriver-all-on-docker.json b/nodes/local-screwdriver-all-on-docker.json new file mode 100644 index 0000000..7e68481 --- /dev/null +++ b/nodes/local-screwdriver-all-on-docker.json @@ -0,0 +1,5 @@ +{ + "run_list": [ + "role[screwdriver-all-on-docker]" + ] +} diff --git a/roles/screwdriver-all-on-docker.rb b/roles/screwdriver-all-on-docker.rb new file mode 100644 index 0000000..4052026 --- /dev/null +++ b/roles/screwdriver-all-on-docker.rb @@ -0,0 +1,105 @@ +# +# Copyright 2018, whitestar +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name 'screwdriver-all-on-docker' +description 'Screwdriver with all components on Docker' + +# Default ports +#ui_port = '9000' +#api_port = '9001' +#store_port = '9002' + +run_list( + 'role[docker]', + 'recipe[screwdriver::docker-compose]', +) + +override_attributes( + 'docker-grid' => { + 'engine' => { + #'skip_setup' => true, # default: false + }, + 'compose' => { + #'skip_setup' => true, # default: false + }, + }, + 'screwdriver' => { + 'api' => { + 'config' => { + 'scms' => { + # **REQUIRED**: SCM settings +=begin + 'github.com' => { # id and display name + 'plugin' => 'github', + 'config' => { + # These 3 secrets should be set by the following `['screwdriver']['api']['scms_vault_items']` attribute. + 'oauthClientId' => 'YOU-PROBABLY-WANT-SOMETHING-HERE', # The client id used for OAuth with github. GitHub OAuth (https://developer.github.com/v3/oauth/) + 'oauthClientSecret' => 'AGAIN-SOMETHING-HERE-IS-USEFUL', # The client secret used for OAuth with github + 'secret' => 'SUPER-SECRET-SIGNING-THING', # Secret to add to GitHub webhooks so that we can validate them + #'gheHost' => 'github.screwdriver.cd', # [Optional] GitHub enterprise host + 'username' => 'sd-buildbot', # [Optional] Username for code checkout + 'email' => 'dev-null@screwdriver.cd', # [Optional] Email for code checkout + 'privateRepo' => false, # [Optional] Set to true to support private repo; will need read and write access to public and private repos (https://developer.github.com/v3/oauth/#scopes) + }, + }, +=end + }, + }, + }, + 'store' => { + 'backend' => { + 'minio', + }, + }, + 'docker-compose' => { + 'config' => { + 'services' => { + 'api' => { + 'ports' => [ + #"#{api_port}:80", + ], + 'environment' => { + #'NODE_TLS_REJECT_UNAUTHORIZED' => '0', # for self-signed cetificates + # The following variables will be set by the screwdriver::docker-compose recipe automatically. + #'ECOSYSTEM_UI' => "http://#{node['fqdn']}:#{ui_port}", + #'ECOSYSTEM_STORE' => "http://#{node['fqdn']}:#{store_port}", + 'DATASTORE_SEQUELIZE_DIALECT' => 'mysql', # or 'postgres' + }, + }, + 'ui' => { + 'ports' => [ + #"#{ui_port}:80", + ], + 'environment' => { + # These variables will be set by the screwdriver::docker-compose recipe automatically. + #'ECOSYSTEM_API' => "http://#{node['fqdn']}:#{api_port}", + #'ECOSYSTEM_STORE' => "http://#{node['fqdn']}:#{store_port}", + }, + }, + 'store' => { + 'ports' => [ + #"#{store_port}:80", + ], + 'environment' => { + # This variable will be set by the screwdriver::docker-compose recipe automatically. + #'ECOSYSTEM_UI' => "http://#{node['fqdn']}:#{ui_port}", + }, + }, + }, + }, + }, + }, +) -- 2.11.0