docker-build 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/docker-build.gemspec +4 -4
- data/lib/composer.rb +19 -10
- data/lib/docker-build.rb +5 -0
- data/lib/symfony/doctrine.rb +28 -0
- data/lib/symfony/symfony.rb +8 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2a8b4a4727f5e9dae3dc5030ea7316df91108bd
|
4
|
+
data.tar.gz: 6f582433ef23546f12910be27d5e4cbb7798161d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fbbe0abe9b70209b8bb5e9314e394bde889cb6a38a21a0b0659db21cb5db2309dac17446114bf9f867975ac97ff8a922ac38f630c0deb9640ae9660a6d7a6dd
|
7
|
+
data.tar.gz: dd8e4eab7e326353874f89776fc98e8ffc498452028dc1be971fd424d7ee955b9bb44e314a9cc4f33047df976c5465ed11dded8b5ea504bfee2749c1e5adb482
|
data/.gitignore
ADDED
data/docker-build.gemspec
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'docker-build'
|
3
|
-
s.version = `git describe --abbrev=0`.strip
|
4
|
-
s.date = `date +"%Y-%m-%d"`.strip
|
3
|
+
s.version = `git describe --abbrev=0`.strip
|
4
|
+
s.date = `date +"%Y-%m-%d"`.strip
|
5
5
|
s.summary = 'Preset tasks for Rake'
|
6
|
-
s.description = 'Preset tasks for Rake when building projects'
|
6
|
+
s.description = 'Preset tasks for Rake when building projects with Docker'
|
7
7
|
s.authors = ['VJ Patel']
|
8
8
|
s.email = 'meetthevj@gmail.com'
|
9
9
|
s.files = `git ls-files`.split("\n")
|
10
10
|
s.homepage = 'http://rubygems.org/gems/docker-build'
|
11
|
-
s.license
|
11
|
+
s.license = 'MIT'
|
12
12
|
end
|
data/lib/composer.rb
CHANGED
@@ -1,21 +1,30 @@
|
|
1
1
|
class Composer
|
2
2
|
|
3
|
-
def self.development
|
4
|
-
puts '
|
5
|
-
|
6
|
-
|
3
|
+
def self.development(env)
|
4
|
+
puts '-- Installing Composer development dependencies'
|
5
|
+
docker_command = self.get_docker_command(env) + 'install --verbose --profile'
|
6
|
+
puts '---- Running: ' << docker_command
|
7
|
+
fail 'Composer development installation failed' unless system docker_command
|
7
8
|
end
|
8
9
|
|
9
|
-
def self.production
|
10
|
-
puts '----
|
11
|
-
|
12
|
-
|
10
|
+
def self.production(env)
|
11
|
+
puts '---- Installing Composer production dependencies'
|
12
|
+
docker_command = self.get_docker_command(env) + 'install --no-dev --optimize-autoloader --no-interaction --verbose --profile'
|
13
|
+
puts '---- Running: ' << docker_command
|
14
|
+
fail 'Composer production installation failed' unless system docker_command
|
13
15
|
end
|
14
16
|
|
15
17
|
private
|
16
|
-
def self.get_docker_command
|
18
|
+
def self.get_docker_command(env)
|
17
19
|
puts '---- Launching Composer container'
|
18
|
-
|
20
|
+
docker_env_vars = env.map{|k,v| "#{k}=#{v}"}.join(' --env ')
|
21
|
+
docker_command = 'docker run --rm -v `pwd`:/app '
|
22
|
+
if docker_env_vars.length > 5
|
23
|
+
docker_command << "--env #{docker_env_vars} "
|
24
|
+
end
|
25
|
+
docker_command << 'vjftw/composer '
|
26
|
+
|
27
|
+
return docker_command
|
19
28
|
end
|
20
29
|
|
21
30
|
end
|
data/lib/docker-build.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
class Doctrine
|
2
|
+
|
3
|
+
def self.create_database(data_container, db_container = nil)
|
4
|
+
puts '-- Creating Symfony Doctrine database'
|
5
|
+
docker_command = self.get_docker_command(data_container, db_container) << 'doctrine:database:create'
|
6
|
+
puts '---- Running: ' << docker_command
|
7
|
+
output = `#{docker_command}`
|
8
|
+
print output
|
9
|
+
fail 'Database creation failed!' unless /(exists|Created)/.match(output)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.run_migrations(data_container, db_container = nil)
|
13
|
+
puts '-- Running Symfony Doctrine migrations'
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
def self.get_docker_command(data_container, db_container = nil)
|
19
|
+
docker_command = "docker run -it --rm --volumes-from #{data_container} "
|
20
|
+
if db_container != nil
|
21
|
+
docker_command << "--link #{db_container}:#{db_container} "
|
22
|
+
end
|
23
|
+
docker_command << 'vjftw/php-cli app/console --ansi '
|
24
|
+
|
25
|
+
return docker_command
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
metadata
CHANGED
@@ -1,26 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docker-build
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VJ Patel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Preset tasks for Rake when building projects
|
13
|
+
description: Preset tasks for Rake when building projects with Docker
|
14
14
|
email: meetthevj@gmail.com
|
15
15
|
executables: []
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
+
- ".gitignore"
|
19
20
|
- LICENSE
|
20
21
|
- README.md
|
21
22
|
- docker-build.gemspec
|
22
23
|
- lib/composer.rb
|
23
24
|
- lib/docker-build.rb
|
25
|
+
- lib/symfony/doctrine.rb
|
26
|
+
- lib/symfony/symfony.rb
|
24
27
|
homepage: http://rubygems.org/gems/docker-build
|
25
28
|
licenses:
|
26
29
|
- MIT
|