middleman-firebase 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 55d1c247176bb86bf4df1fe0e930a29344a01f51
4
+ data.tar.gz: 01c12c1ed75b620553e98dc2a44e985047ddc051
5
+ SHA512:
6
+ metadata.gz: eec6c0e91c7036fdba1b8bf15f73ea12a07c0a6dbec5fcc73f2993f20e28b8518ba3bdef17f3b1dd98d6c031610fea27b88384e5db28b52179c61f07633ab7fe
7
+ data.tar.gz: 0ad560dd572465674b61ffd2ba6e28a4781c657fa6639341cbccde4e941752c2b43e5283c4ea103922117f6d3986bc35b6038077a1177b55f69bb239a6f58e38
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.3.3
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in middleman-firebase.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Marnen Laibow-Koser
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # Middleman::Firebase
2
+
3
+ This gem contains some basic Rake tasks to automate deployment of [Middleman](http://www.middlemanapp.com) sites to [Firebase Hosting](https://firebase.google.com/docs/hosting/).
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'middleman-firebase'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install middleman-firebase
20
+
21
+ ## Usage
22
+
23
+ Add the following line to your Rakefile:
24
+
25
+ ```ruby
26
+ require 'middleman/firebase/tasks'
27
+ ```
28
+
29
+ If you now list your Rake tasks with `rake -T`, you'll see several tasks in the `firebase` namespace, as well as `middleman:build` (which just builds the site into the `build` directory). The most useful of these tasks is probably `firebase:deploy`, which (if you have your Firebase CLI client configured) will build the Middleman site, push it to Firebase, and make a Git tag for the deployed version.
30
+
31
+ ## Development
32
+
33
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
34
+
35
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
36
+
37
+ ## Contributing
38
+
39
+ Bug reports and pull requests are welcome on Bitbucket at https://bitbucket.org/marnen/middleman-firebase. (I might move to GitHub at some point, since I like it better; the Microsoft acquisition is causing some uncertainty for me.)
40
+
41
+
42
+ ## License
43
+
44
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "middleman/firebase"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,59 @@
1
+ require 'json'
2
+
3
+ def rake_task(name, argument_hash)
4
+ Rake::Task[name].execute Rake::TaskArguments.new(argument_hash.keys, argument_hash.values)
5
+ end
6
+
7
+ def git_tag
8
+ hosting_key = @deploy_status['result']['hosting']
9
+ "firebase-#{hosting_key}"
10
+ end
11
+
12
+ def promote(from: :development, to: :staging)
13
+ sh 'firebase', 'promote', from.to_s, to.to_s
14
+ rake_task :tag, environment: to, ref: git_tag(from)
15
+ end
16
+
17
+ namespace :middleman do
18
+ desc 'Build site into /build directory'
19
+ task :build do
20
+ sh *%w(middleman build --clean)
21
+ end
22
+ end
23
+
24
+ namespace :firebase do
25
+ desc 'Build and deploy to Firebase'
26
+ task deploy: :'deploy:all'
27
+
28
+ task :tag, [:environment, :ref] do |_, args|
29
+ args.with_defaults ref: 'head'
30
+ sh 'git', 'tag', git_tag, args[:ref]
31
+ end
32
+
33
+ namespace :deploy do
34
+ task all: [:build, :push] do
35
+ rake_task :tag, environment: 'development'
36
+ end
37
+
38
+ task :push do
39
+ git_commit = `git rev-parse HEAD`.strip
40
+ deploy_output = `firebase deploy --only hosting -j -m 'Git commit #{git_commit}'`
41
+ deploy_output.sub! %r(\A[^{]*), ''
42
+ @deploy_status = JSON.parse deploy_output
43
+ warn "Deploy status:"
44
+ warn @deploy_status.inspect
45
+ end
46
+ end
47
+
48
+ namespace :promote do
49
+ desc 'Promote current development version to staging'
50
+ task :staging do
51
+ promote from: :development, to: :staging
52
+ end
53
+
54
+ desc 'Promote current staging version to production'
55
+ task :production do
56
+ promote from: :staging, to: :production
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,2 @@
1
+ path = File.expand_path(__dir__)
2
+ Dir.glob("#{path}/tasks/**/*.rake").each { |f| import f }
@@ -0,0 +1,5 @@
1
+ module Middleman
2
+ module Firebase
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ require "middleman/firebase/version"
2
+
3
+ module Middleman
4
+ module Firebase
5
+ # Your code goes here...
6
+ end
7
+ end
@@ -0,0 +1,40 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'middleman/firebase/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "middleman-firebase"
8
+ spec.version = Middleman::Firebase::VERSION
9
+ spec.authors = ["Marnen Laibow-Koser"]
10
+ spec.email = ["marnen@marnen.org"]
11
+
12
+ spec.summary = %q{Tools for deploying Middleman sites to Firebase Hosting}
13
+ # spec.description = %q{TODO: Write a longer description or delete this line.}
14
+ spec.homepage = "https://bitbucket.org/marnen/middleman-firebase"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ # if spec.respond_to?(:metadata)
20
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
21
+ # else
22
+ # raise "RubyGems 2.0 or newer is required to protect against " \
23
+ # "public gem pushes."
24
+ # end
25
+
26
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
+ f.match(%r{^(test|spec|features)/})
28
+ end
29
+ spec.bindir = "exe"
30
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
+ spec.require_paths = ["lib"]
32
+
33
+ spec.add_development_dependency "bundler", "~> 1.14"
34
+ spec.add_development_dependency "rake", "~> 10.0"
35
+
36
+ [
37
+ ['middleman', '>= 4.0.0'],
38
+ 'rake'
39
+ ].each {|gem| spec.add_runtime_dependency *gem }
40
+ end
metadata ADDED
@@ -0,0 +1,113 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: middleman-firebase
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Marnen Laibow-Koser
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-06-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.14'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.14'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: middleman
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 4.0.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 4.0.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description:
70
+ email:
71
+ - marnen@marnen.org
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".ruby-version"
78
+ - Gemfile
79
+ - LICENSE.txt
80
+ - README.md
81
+ - Rakefile
82
+ - bin/console
83
+ - bin/setup
84
+ - lib/middleman/firebase.rb
85
+ - lib/middleman/firebase/tasks.rb
86
+ - lib/middleman/firebase/tasks/deploy.rake
87
+ - lib/middleman/firebase/version.rb
88
+ - middleman-firebase.gemspec
89
+ homepage: https://bitbucket.org/marnen/middleman-firebase
90
+ licenses:
91
+ - MIT
92
+ metadata: {}
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubyforge_project:
109
+ rubygems_version: 2.5.2
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: Tools for deploying Middleman sites to Firebase Hosting
113
+ test_files: []