dpl 1.8.22.travis.1686.3 → 1.8.22.travis.1692.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +18 -0
- data/lib/dpl/provider.rb +1 -0
- data/lib/dpl/provider/pages.rb +76 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGEwNWUwZDcxNDkyNWQ2NDc0MTAwNWE4YTRmMjAyYzRmNzY1ZTc0MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDJmNDg1MjczZDM0Y2I5YjdkOThkNzRkYzM5ZmMyMjc4MjYyY2ExMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2JjOTlmZDUxY2Q0NjhhMWQ4MjJjYjk2Y2NiNTJlNDlkMzFiODE1NjM5NDFi
|
10
|
+
ODdkMDhmY2UwZGEyZDY1ZGU2YjIwZTgxN2U1N2ZmNmVmN2VmMWU4ZGJiM2Qw
|
11
|
+
MGM4ZjM1ZmU2MTM0ZTFkODExOGFmZDdkZDI2ZWJjYjMwYWFlOWM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTkzNTQ5ZjczNGRiMTg2MjNmNGFkZWQyMTkyMDk4OWYzMjc4YTk1ZjJkNmQ3
|
14
|
+
YzJkNGQxYTdiYTk0OTJhZGE3NzYyYTI0OWVhNzcxN2Y1Y2U2ZDRkNDg1Yzgz
|
15
|
+
MDRhNzQ2ODQ3MTAzMDg3MTY2Mzg3MTZjNzA0MWNkMTZmNDU4YzA=
|
data/README.md
CHANGED
@@ -26,6 +26,7 @@ Dpl supports the following providers:
|
|
26
26
|
* [Engine Yard](#engine-yard)
|
27
27
|
* [ExoScale](#exoscale)
|
28
28
|
* [Firebase](#firebase)
|
29
|
+
* [Github Pages](#github-pages)
|
29
30
|
* [Github Releases](#github-releases)
|
30
31
|
* [Google App Engine (experimental)](#google-app-engine)
|
31
32
|
* [Google Cloud Storage](#google-cloud-storage)
|
@@ -506,6 +507,23 @@ You first need to create an [Atlas account](https://atlas.hashicorp.com/account/
|
|
506
507
|
|
507
508
|
dpl --provider=cloudfiles --username=<username> --api-key=<api-key> --region=<region> --container=<container>
|
508
509
|
|
510
|
+
### GitHub Pages:
|
511
|
+
|
512
|
+
#### Options:
|
513
|
+
|
514
|
+
* **github-token**: GitHub oauth token with `repo` permission.
|
515
|
+
* **repo**: Repo slug, defaults to current one.
|
516
|
+
* **target-branch**: Branch to push force to, defaults to gh-pages.
|
517
|
+
* **local-dir**: Directory to push to GitHub Pages, defaults to current.
|
518
|
+
* **fqdn**: Optional, no default, sets a main domain for your website.
|
519
|
+
* **project-name**: Defaults to fqdn or repo slug, used for metadata.
|
520
|
+
* **email**: Optional, comitter info, defaults to deploy@travis-ci.org.
|
521
|
+
* **name**: Optional, comitter, defaults to Deployment Bot.
|
522
|
+
|
523
|
+
#### Examples:
|
524
|
+
|
525
|
+
dpl --provider=pages --github-token=<api-key> --local-dir=build
|
526
|
+
|
509
527
|
### GitHub Releases:
|
510
528
|
|
511
529
|
#### Options:
|
data/lib/dpl/provider.rb
CHANGED
@@ -36,6 +36,7 @@ module DPL
|
|
36
36
|
autoload :Openshift, 'dpl/provider/openshift'
|
37
37
|
autoload :OpsWorks, 'dpl/provider/ops_works'
|
38
38
|
autoload :Packagecloud, 'dpl/provider/packagecloud'
|
39
|
+
autoload :Pages, 'dpl/provider/pages'
|
39
40
|
autoload :PuppetForge, 'dpl/provider/puppet_forge'
|
40
41
|
autoload :PyPI, 'dpl/provider/pypi'
|
41
42
|
autoload :Releases, 'dpl/provider/releases'
|
@@ -0,0 +1,76 @@
|
|
1
|
+
module DPL
|
2
|
+
class Provider
|
3
|
+
class Pages < Provider
|
4
|
+
"""Implements Github Pages deployment
|
5
|
+
|
6
|
+
Options:
|
7
|
+
- repo [optional, for pushed to other repos]
|
8
|
+
- github-token [required]
|
9
|
+
- target-branch [optional, defaults to gh-pages]
|
10
|
+
- local-dir [optional, defaults to `pwd`]
|
11
|
+
- fqdn [optional]
|
12
|
+
- project-name [optional, defaults to fqdn or repo slug]
|
13
|
+
- email [optional, defaults to deploy@travis-ci.org]
|
14
|
+
- name [optional, defaults to Deployment Bot]
|
15
|
+
"""
|
16
|
+
|
17
|
+
require 'tmpdir'
|
18
|
+
|
19
|
+
|
20
|
+
def initialize(context, options)
|
21
|
+
super
|
22
|
+
|
23
|
+
@build_dir = options[:local_dir] || '.'
|
24
|
+
|
25
|
+
@project_name = options[:project_name] || fqdn || slug
|
26
|
+
@gh_fqdn = fqdn
|
27
|
+
|
28
|
+
@gh_ref = "github.com/#{slug}.git"
|
29
|
+
@target_branch = options[:target_branch] || 'gh-pages'
|
30
|
+
@gh_token = option(:github_token)
|
31
|
+
|
32
|
+
@gh_email = options[:email] || 'deploy@travis-ci.org'
|
33
|
+
@gh_name = "#{options[:name] || 'Deployment Bot'} (from Travis CI)"
|
34
|
+
end
|
35
|
+
|
36
|
+
def fqdn
|
37
|
+
options.fetch(:fqdn) { nil }
|
38
|
+
end
|
39
|
+
|
40
|
+
def slug
|
41
|
+
options.fetch(:repo) { context.env['TRAVIS_REPO_SLUG'] }
|
42
|
+
end
|
43
|
+
|
44
|
+
def check_auth
|
45
|
+
end
|
46
|
+
|
47
|
+
def needs_key?
|
48
|
+
false
|
49
|
+
end
|
50
|
+
|
51
|
+
def github_deploy
|
52
|
+
context.shell 'rm -rf .git > /dev/null 2>&1'
|
53
|
+
context.shell "touch \"deployed at `date` by #{@gh_name}\""
|
54
|
+
context.shell 'git init' or raise 'Could not create new git repo'
|
55
|
+
context.shell "git config user.email '#{@gh_email}'"
|
56
|
+
context.shell "git config user.name '#{@gh_name}'"
|
57
|
+
context.shell "echo '#{@gh_fqdn}' > CNAME" if @gh_fqdn
|
58
|
+
context.shell 'git add .'
|
59
|
+
context.shell "git commit -m 'Deploy #{@project_name} to #{@gh_ref}:#{@target_branch}'"
|
60
|
+
context.shell "git push --force --quiet 'https://#{@gh_token}@#{@gh_ref}' master:#{@target_branch} > /dev/null 2>&1"
|
61
|
+
end
|
62
|
+
|
63
|
+
def push_app
|
64
|
+
Dir.mktmpdir {|tmpdir|
|
65
|
+
FileUtils.cp_r("#{@build_dir}/.", tmpdir)
|
66
|
+
FileUtils.cd(tmpdir, :verbose => true) do
|
67
|
+
unless github_deploy
|
68
|
+
error "Couldn't push the build to #{@gh_ref}:#{@target_branch}"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dpl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.22.travis.
|
4
|
+
version: 1.8.22.travis.1692.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Haase
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -158,6 +158,7 @@ files:
|
|
158
158
|
- lib/dpl/provider/openshift.rb
|
159
159
|
- lib/dpl/provider/ops_works.rb
|
160
160
|
- lib/dpl/provider/packagecloud.rb
|
161
|
+
- lib/dpl/provider/pages.rb
|
161
162
|
- lib/dpl/provider/puppet_forge.rb
|
162
163
|
- lib/dpl/provider/pypi.rb
|
163
164
|
- lib/dpl/provider/releases.rb
|