docker-build 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/docker-build.rb +1 -1
- data/lib/docker/google.rb +15 -7
- data/lib/symfony/symfony.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c01b298aefd260a725ada099c64549de06bb72e9
|
4
|
+
data.tar.gz: 136772c23f5fdecf4beb0591f494fca179a5f56b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bef3e66c3f4d92d5b8df5a60f523d536bcf80f9e2952f9a759fbc7a30003c32598209f03534d22d06d679a41d2820111e42acdb1a79ed649907bf64514903bb
|
7
|
+
data.tar.gz: 3275d18d980191b6ad4ad3b6e6d4207d8c3c27a9da77f1c306572d77f90d9fd3dce3ce319c01f0978a5309cfae6fe0303aa7ecf4aba7f43947f7bf595604161a
|
data/lib/docker-build.rb
CHANGED
data/lib/docker/google.rb
CHANGED
@@ -1,19 +1,27 @@
|
|
1
1
|
class Google
|
2
2
|
|
3
|
-
def self.tag_container(image_id, repo, project_id)
|
4
|
-
time = Time.new
|
5
|
-
image_timestamp = "#{time.year}-#{time.month}-#{time.day}_#{time.hour}#{time.min}#{time.sec}"
|
3
|
+
def self.tag_container(image_id, repo, project_id, cached=false)
|
6
4
|
branch = `git rev-parse --abbrev-ref HEAD`.strip
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
commit = `git rev-parse --short HEAD`.strip
|
6
|
+
tag = "#{repo}/#{project_id}:#{branch}-#{commit}-"
|
7
|
+
if cached
|
8
|
+
tag << 'cached'
|
9
|
+
else
|
10
|
+
tag << 'uncached'
|
11
|
+
end
|
11
12
|
command = "docker tag #{image_id} #{tag}"
|
12
13
|
puts command
|
13
14
|
system command
|
14
15
|
return tag
|
15
16
|
end
|
16
17
|
|
18
|
+
def self.tag_latest(image_id, repo, project_id)
|
19
|
+
branch = `git rev-parse --abbrev-ref HEAD`.strip
|
20
|
+
command = "docker tag -f #{image_id} #{repo}/#{project_id}:#{branch}-latest"
|
21
|
+
puts command
|
22
|
+
system command
|
23
|
+
end
|
24
|
+
|
17
25
|
def self.push_container(image_tag)
|
18
26
|
command = "gcloud preview docker push #{image_tag}"
|
19
27
|
fail "Could not push container: #{image_tag}" unless system(command)
|
data/lib/symfony/symfony.rb
CHANGED
@@ -4,6 +4,12 @@ class Symfony
|
|
4
4
|
Doctrine
|
5
5
|
end
|
6
6
|
|
7
|
+
def self.purge_cache(data_container)
|
8
|
+
puts `docker run --rm --volumes-from #{data_container} vjftw/data /bin/bash -l -c "mkdir -p app/cache"`
|
9
|
+
puts `docker run --rm --volumes-from #{data_container} vjftw/data /bin/bash -l -c "rm -rf app/cache/*"`
|
10
|
+
puts `docker run --rm --volumes-from #{data_container} vjftw/data /bin/bash -l -c "chmod -R 777 app/cache"`
|
11
|
+
end
|
12
|
+
|
7
13
|
def self.run_command(data_container, command)
|
8
14
|
docker_command = "docker run --rm --volumes-from #{data_container} vjftw/php-cli app/console --ansi #{command}"
|
9
15
|
|