odania-static-pages 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7daf33ae327e89440d7c6c34a5f9617b84eadc8
4
- data.tar.gz: 79a77a816c345f184dd89b81da735a56dbdd233c
3
+ metadata.gz: fdf1d65c68bf508a1cd71caf770b1a0c483e5428
4
+ data.tar.gz: c8cfc0da9684acc62e72308bfb5a4686f274234a
5
5
  SHA512:
6
- metadata.gz: 81d3320c164d9cada2fe2d532347252b8ff1059267391209226071c3f8985bca2da0c76a383c54f0943c9d65cc4b692418771a7c43bc5262002509d23b631f09
7
- data.tar.gz: d2c5390105a055afb7757a2354f45c6d1a2de600831a7e7feac2d394313d03a53c4558c657859bfa48ef0a9a3428869c56f3780a54b57dbbe73d0fe13b48c8f9
6
+ metadata.gz: d69ad404e678ce5c427a496020c474ecb0ceb21308dbc077aa4fb86fc99ecf3891bb61843cee3e43e0ee265e75c4844f45f91d59a0d6c03937e1447a65cc6a52
7
+ data.tar.gz: 0f028e9dc997ce99e574c97a55d5f11562f1fb66a7f08910444bc58bd0e2050240d47ca5c59b5bbd91c3def015af20caba7348dc32d4115bc5418b07be287b3d
@@ -49,6 +49,8 @@ module OdaniaStaticPages
49
49
  end
50
50
 
51
51
  puts ' -> Linking Gemfile*'
52
+ dot_bundle_folder = File.join(full_common_folder, '.bundle')
53
+ FileUtils.ln_s dot_bundle_folder, page_path, force: true if File.exist? dot_bundle_folder
52
54
  FileUtils.ln_s File.join(full_common_folder, 'Gemfile'), File.join(page_path, 'Gemfile'), force: true
53
55
  FileUtils.ln_s File.join(full_common_folder, 'Gemfile.lock'), File.join(page_path, 'Gemfile.lock'), force: true
54
56
 
@@ -64,6 +64,11 @@ module OdaniaStaticPages
64
64
  end
65
65
 
66
66
  def current_environment
67
+ if @environments[@environment].nil?
68
+ puts "Environment #{environment} no found!"
69
+ puts "Available Environments: #{@environments.keys}"
70
+ exit 1
71
+ end
67
72
  @environments[@environment]
68
73
  end
69
74
 
@@ -55,7 +55,7 @@ module OdaniaStaticPages
55
55
  compose_file = File.join(@config.project_dir, environment.output_path, 'docker-compose.yml')
56
56
 
57
57
  puts "Writing docker compose to #{compose_file}"
58
- docker_compose_generator = DockerComposeGenerator.new @config, environment
58
+ docker_compose_generator = DockerComposeGenerator.new @config, environment, @nginx_conf_dir
59
59
  docker_compose_generator.write compose_file
60
60
  end
61
61
 
@@ -66,6 +66,7 @@ module OdaniaStaticPages
66
66
  full_site_name = "#{site_name}.lvh.me"
67
67
  puts "Writing vhost for: #{full_site_name}"
68
68
  expires = @deploy_config.expires
69
+ FileUtils.mkdir_p @nginx_conf_dir
69
70
  File.write File.join(@nginx_conf_dir, "#{site_name}.conf"), vhost_renderer.result(binding)
70
71
 
71
72
  sites[site_name] = "#{site_name}.lvh.me:8080"
@@ -76,6 +77,7 @@ module OdaniaStaticPages
76
77
  end
77
78
 
78
79
  puts 'Generating index.html'
80
+ FileUtils.mkdir_p @config.output_site_path
79
81
  renderer = ERB.new(File.read(File.join(@config.base_dir, 'templates', 'nginx', 'index.html.erb')))
80
82
  File.write File.join(@config.output_site_path, 'index.html'), renderer.result(binding)
81
83
 
@@ -127,9 +129,9 @@ module OdaniaStaticPages
127
129
  class DockerComposeGenerator
128
130
  attr_reader :nginx_volume_html, :nginx_volume_conf_d, :nginx_volume_nginx_conf, :compose_images
129
131
 
130
- def initialize(config, environment)
132
+ def initialize(config, environment, nginx_conf_dir)
131
133
  @nginx_volume_html = "#{config.output_site_path}:/srv:ro"
132
- @nginx_volume_conf_d = "#{@nginx_conf_dir}:/etc/nginx/conf.d:ro"
134
+ @nginx_volume_conf_d = "#{nginx_conf_dir}:/etc/nginx/conf.d:ro"
133
135
  @nginx_volume_nginx_conf = "#{File.join(config.output_path, 'nginx', 'nginx.conf')}:/etc/nginx/nginx.conf"
134
136
  @compose_images = environment.deploy_module.compose_images
135
137
  @erb_template = File.join(config.base_dir, 'templates', 'docker-compose', 'docker-compose.yml.erb')
@@ -91,7 +91,9 @@ module OdaniaStaticPages
91
91
  puts `cd #{File.join(@generator_config.pages_dir, site_path)} && bundle check`
92
92
  puts `cd #{File.join(@generator_config.pages_dir, site_path)} && bundle install --path ~/.gems` unless $?.success?
93
93
 
94
- cmd = "cd #{ File.join(@generator_config.pages_dir, site_path) } && JEKYLL_ENV=#{jekyll_env} bundle exec jekyll build #{options}"
94
+ full_site_path = File.join(@generator_config.pages_dir, site_path)
95
+ env_vars = "BUNDLE_GEMFILE=#{full_site_path}/Gemfile JEKYLL_ENV=#{jekyll_env}"
96
+ cmd = "cd #{full_site_path} && #{env_vars} bundle exec jekyll build #{options}"
95
97
  puts " -> Building site [cmd: #{cmd}]"
96
98
  unless system(cmd)
97
99
  puts "Error building site: #{site_path}"
@@ -1,3 +1,3 @@
1
1
  module OdaniaStaticPages
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odania-static-pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Petersen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-24 00:00:00.000000000 Z
11
+ date: 2017-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  version: '0'
190
190
  requirements: []
191
191
  rubyforge_project:
192
- rubygems_version: 2.6.10
192
+ rubygems_version: 2.6.14
193
193
  signing_key:
194
194
  specification_version: 4
195
195
  summary: Helper For creating static pages