-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
31 lines (25 loc) · 818 Bytes
/
Rakefile
File metadata and controls
31 lines (25 loc) · 818 Bytes
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
sha = `git rev-parse --short HEAD`.chomp
image_name = "r5/sidekiqui:#{sha}"
task :default => :test
desc "Run tests"
task :test => [:build_image] do
system "docker run -it --env-file .env #{image_name} bundle exec ruby sidekiqui_test.rb"
end
desc "Launch a shell"
task :shell => [:build_image] do
system "docker run -it --env-file .env #{image_name} bash"
end
desc "Run bundler"
task :bundle => [:build_image] do
system "docker run -t -v $(pwd)/Gemfile:/app/Gemfile -v $(pwd)/Gemfile.lock:/app/Gemfile.lock #{image_name} bundle update"
end
desc "Build Docker image"
task :build_image do
system "docker build -t #{image_name} ."
end
desc "Push Docker image to repo"
task :push_image do
tag = "quay.io/recfive/sidekiqui:#{sha}"
system "docker tag #{image_name} #{tag}"
system "docker push #{tag}"
end