forked from heroku/heroku-buildpack-emberjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
49 lines (40 loc) · 1.16 KB
/
Rakefile
1
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
48
49
require 'tmpdir'
require 'fileutils'
desc "Build and stage buildpack in a tmpdir"
task :stage do
@dir = Dir.mktmpdir
sh "git clone . #{@dir}"
Dir.chdir(@dir) do
Dir.chdir("buildpack") do
sh "docker-compose run compile"
end
FileUtils.mkdir_p("vendor")
FileUtils.cp("buildpack/mruby/build/x86_64-pc-linux-gnu/bin/buildpack", "vendor")
sh "sudo rm -rf buildpack"
FileUtils.rm("Rakefile")
end
puts @dir
end
desc "Publish buildpack to https://buildkits.herokuapp.com"
task :publish, [:name] => :stage do |t, args|
Dir.chdir(@dir) do
sh "heroku buildkits:publish #{args[:name]}"
end
end
namespace :dev do
desc "Publish dev build of buildpack to https://buildkits.herokuapp.com"
task :publish, [:name] do |t, args|
cwd = File.dirname(__FILE__)
Dir.chdir("buildpack") do
sh "docker-compose run compile"
end
Dir.mktmpdir do |dir|
Dir.chdir(dir) do
FileUtils.mkdir_p("vendor")
FileUtils.cp("#{cwd}/buildpack/mruby/build/x86_64-pc-linux-gnu/bin/buildpack", "vendor")
FileUtils.cp_r("#{cwd}/bin", ".")
sh "heroku buildkits:publish #{args[:name]}"
end
end
end
end