5e1e2d65e5c2980f0f14a6c509deb53889f35d02
1 # simple build file to be used locally by Sam
6 TODO
= [:base, :discourse_test, :discourse_dev]
7 VERSION
= "2.0.#{Time.now.strftime('%Y%m%d')}"
10 base
: { name
: 'base', tag
: "discourse/base:", squash
: true },
11 discourse_test
: { name
: 'discourse_test', tag
: "discourse/discourse_test:", squash
: false},
12 discourse_dev
: { name
: 'discourse_dev', tag
: "discourse/discourse_dev:", squash
: false }
17 PTY
.spawn(command
) do |stdin, stdout, pid
|
32 lines
= run("cd #{image[:name]} && docker build . --no-cache --tag #{image[:tag] + VERSION} #{image[:squash] ? '#--squash' : ''}")
33 raise "Error building the image for #{image[:name]}: #{lines[-1]}" if lines
[-1] =~
/successfully built/
34 run("docker tag #{image[:tag] + VERSION} #{image[:tag]}release")
38 run("sed -e 's/\(db_name: discourse\)/\1_development/' ../templates/postgres.template.yml > discourse_dev/postgres.template.yml")
39 run("cp ../templates/redis.template.yml discourse_dev/redis.template.yml")
45 dev_deps() if image
== :discourse_dev
46 run
"(cd base && ./download_phantomjs)" if image
== :base