2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/potassium/recipes/ci.rb', line 2
def create
copy_file '../assets/Dockerfile.ci', 'Dockerfile.ci'
copy_file '../assets/.circleci/config.yml', '.circleci/config.yml'
template '../assets/bin/cibuild.erb', 'bin/cibuild'
run "chmod a+x bin/cibuild"
copy_file '../assets/docker-compose.ci.yml', 'docker-compose.ci.yml'
gather_gems(:test) do
gather_gem 'rspec_junit_formatter', '0.2.2'
end
compose = DockerHelpers.new('docker-compose.ci.yml')
if selected?(:database, :mysql)
srv =
" image: \"mysql:5.6.23\"\n environment:\n MYSQL_ALLOW_EMPTY_PASSWORD: 'true'\n YAML\n compose.add_service(\"mysql\", srv)\n compose.add_link('test', 'mysql')\n compose.add_env('test', 'MYSQL_HOST', 'mysql')\n compose.add_env('test', 'MYSQL_PORT', '3306')\n\n elsif selected?(:database, :postgresql)\n srv =\n <<~YAML\n image: \"postgres:9.4.5\"\n environment:\n POSTGRES_USER: postgres\n POSTGRES_PASSWORD: ''\n YAML\n compose.add_service(\"postgresql\", srv)\n compose.add_link('test', 'postgresql')\n compose.add_env('test', 'POSTGRESQL_USER', 'postgres')\n compose.add_env('test', 'POSTGRESQL_HOST', 'postgresql')\n compose.add_env('test', 'POSTGRESQL_PORT', '5432')\n end\n\n add_readme_header :ci\n\n application 'config.assets.js_compressor = :uglifier', env: 'test'\nend\n"
|