dpl-azure_webapps 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/dpl-azure_webapps.gemspec +3 -0
- data/lib/dpl/provider/azure_webapps.rb +48 -0
- data/spec/provider/azure_webapps_spec.rb +95 -0
- metadata +159 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 943c1c916909f99f2781efc3b2760d006f23babc
|
4
|
+
data.tar.gz: ab99da0df7bfd1212f8cb84a27195b86d9cf55af
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 374a3b555ac1a5daa9da710c28691f926646101d34b06ac8adf56512a3d241e91e822e1b8f993e4d3d113f3087d7c14ec3745420c2a8477db4212b1e794954dc
|
7
|
+
data.tar.gz: aa0c17574d666eb0e6597b58ac6d6840d3ea63c99ae7f5f7dec8d3975847ec335e68607700dfeea86158a38c988a0ecfa7b8288dfad1c0a9d2355266c160b854
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module DPL
|
2
|
+
class Provider
|
3
|
+
class AzureWebApps < Provider
|
4
|
+
def config
|
5
|
+
{
|
6
|
+
"username" => options[:username] || context.env['AZURE_WA_USERNAME'],
|
7
|
+
"password" => options[:password] || context.env['AZURE_WA_PASSWORD'],
|
8
|
+
"site" => options[:site] || context.env['AZURE_WA_SITE'],
|
9
|
+
"slot" => options[:slot] || context.env['AZURE_WA_SLOT']
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
13
|
+
def git_target
|
14
|
+
"https://#{config['username']}:#{config['password']}@#{config['slot'] || config['site']}.scm.azurewebsites.net:443/#{config['site']}.git"
|
15
|
+
end
|
16
|
+
|
17
|
+
def needs_key?
|
18
|
+
false
|
19
|
+
end
|
20
|
+
|
21
|
+
def check_app
|
22
|
+
end
|
23
|
+
|
24
|
+
def check_auth
|
25
|
+
error "missing Azure Git Deployment username" unless config['username']
|
26
|
+
error "missing Azure Git Deployment password" unless config['password']
|
27
|
+
error "missing Azure Web App name" unless config['site']
|
28
|
+
end
|
29
|
+
|
30
|
+
def push_app
|
31
|
+
log "Deploying to Azure Web App '#{config['slot'] || config['site']}'"
|
32
|
+
|
33
|
+
if !!options[:skip_cleanup]
|
34
|
+
log "Skipping Cleanup"
|
35
|
+
context.shell "git checkout HEAD"
|
36
|
+
context.shell "git add . --all --force"
|
37
|
+
context.shell "git commit -m \"Skip Cleanup Commit\""
|
38
|
+
end
|
39
|
+
|
40
|
+
if !!options[:verbose]
|
41
|
+
context.shell "git push --force --quiet #{git_target} HEAD:refs/heads/master"
|
42
|
+
else
|
43
|
+
context.shell "git push --force --quiet #{git_target} HEAD:refs/heads/master > /dev/null 2>&1"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'dpl/provider/azure_webapps'
|
3
|
+
|
4
|
+
|
5
|
+
describe DPL::Provider::AzureWebApps do
|
6
|
+
subject :provider do
|
7
|
+
described_class.new(DummyContext.new,
|
8
|
+
:username => 'myUsername',
|
9
|
+
:password => 'myPassword',
|
10
|
+
:site => 'myWebsite',
|
11
|
+
:slot => 'mySlot')
|
12
|
+
end
|
13
|
+
|
14
|
+
subject :provider_without_slot do
|
15
|
+
described_class.new(DummyContext.new,
|
16
|
+
:username => 'myUsername',
|
17
|
+
:password => 'myPassword',
|
18
|
+
:site => 'myWebsite')
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
describe "#git_target" do
|
23
|
+
example "With slot" do
|
24
|
+
expect(provider.git_target).to eq('https://myUsername:myPassword@mySlot.scm.azurewebsites.net:443/myWebsite.git')
|
25
|
+
end
|
26
|
+
|
27
|
+
example "Without slot" do
|
28
|
+
expect(provider_without_slot.git_target).to eq('https://myUsername:myPassword@myWebsite.scm.azurewebsites.net:443/myWebsite.git')
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe "#needs_key?" do
|
33
|
+
example do
|
34
|
+
expect(provider.needs_key?).to eq(false)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe "#check_auth" do
|
39
|
+
example "Without credentials" do
|
40
|
+
provider.options.update(:username => nil)
|
41
|
+
provider.options.update(:password => nil)
|
42
|
+
provider.options.update(:site => nil)
|
43
|
+
expect{provider.check_auth}.to raise_error(DPL::Error, 'missing Azure Git Deployment username')
|
44
|
+
end
|
45
|
+
|
46
|
+
example "Without username" do
|
47
|
+
provider.options.update(:username => nil)
|
48
|
+
expect{provider.check_auth}.to raise_error(DPL::Error, 'missing Azure Git Deployment username')
|
49
|
+
end
|
50
|
+
|
51
|
+
example "Without password" do
|
52
|
+
provider.options.update(:password => nil)
|
53
|
+
expect{provider.check_auth}.to raise_error(DPL::Error, 'missing Azure Git Deployment password')
|
54
|
+
end
|
55
|
+
|
56
|
+
example "Without WebApp name" do
|
57
|
+
provider.options.update(:site => nil)
|
58
|
+
expect{provider.check_auth}.to raise_error(DPL::Error, 'missing Azure Web App name')
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
describe "push_app" do
|
63
|
+
example "skip cleanup" do
|
64
|
+
provider.options.update(:skip_cleanup => true)
|
65
|
+
provider.options.update(:verbose => false)
|
66
|
+
expect(provider.context).to receive(:shell).with('git checkout HEAD')
|
67
|
+
expect(provider.context).to receive(:shell).with('git add . --all --force')
|
68
|
+
expect(provider.context).to receive(:shell).with('git commit -m "Skip Cleanup Commit"')
|
69
|
+
expect(provider.context).to receive(:shell).with('git push --force --quiet https://myUsername:myPassword@mySlot.scm.azurewebsites.net:443/myWebsite.git HEAD:refs/heads/master > /dev/null 2>&1')
|
70
|
+
provider.push_app
|
71
|
+
end
|
72
|
+
|
73
|
+
example "Dont skip cleanup" do
|
74
|
+
provider.options.update(:skip_cleanup => false)
|
75
|
+
provider.options.update(:verbose => false)
|
76
|
+
expect(provider.context).to receive(:shell).with('git push --force --quiet https://myUsername:myPassword@mySlot.scm.azurewebsites.net:443/myWebsite.git HEAD:refs/heads/master > /dev/null 2>&1')
|
77
|
+
provider.push_app
|
78
|
+
end
|
79
|
+
|
80
|
+
example "Verbose" do
|
81
|
+
provider.options.update(:skip_cleanup => false)
|
82
|
+
provider.options.update(:verbose => true)
|
83
|
+
expect(provider.context).to receive(:shell).with('git push --force --quiet https://myUsername:myPassword@mySlot.scm.azurewebsites.net:443/myWebsite.git HEAD:refs/heads/master')
|
84
|
+
provider.push_app
|
85
|
+
end
|
86
|
+
|
87
|
+
example "Not verbose" do
|
88
|
+
provider.options.update(:skip_cleanup => false)
|
89
|
+
provider.options.update(:verbose => false)
|
90
|
+
expect(provider.context).to receive(:shell).with('git push --force --quiet https://myUsername:myPassword@mySlot.scm.azurewebsites.net:443/myWebsite.git HEAD:refs/heads/master > /dev/null 2>&1')
|
91
|
+
provider.push_app
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
metadata
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dpl-azure_webapps
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.9.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Konstantin Haase
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-03-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dpl
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.9.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.9.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec-its
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '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: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: json_pure
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: tins
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: coveralls
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: highline
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: deploy tool abstraction for clients
|
126
|
+
email: konstantin.mailinglists@googlemail.com
|
127
|
+
executables: []
|
128
|
+
extensions: []
|
129
|
+
extra_rdoc_files: []
|
130
|
+
files:
|
131
|
+
- dpl-azure_webapps.gemspec
|
132
|
+
- lib/dpl/provider/azure_webapps.rb
|
133
|
+
- spec/provider/azure_webapps_spec.rb
|
134
|
+
homepage: https://github.com/travis-ci/dpl
|
135
|
+
licenses:
|
136
|
+
- MIT
|
137
|
+
metadata: {}
|
138
|
+
post_install_message:
|
139
|
+
rdoc_options: []
|
140
|
+
require_paths:
|
141
|
+
- lib
|
142
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '2.2'
|
147
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0'
|
152
|
+
requirements: []
|
153
|
+
rubyforge_project:
|
154
|
+
rubygems_version: 2.6.13
|
155
|
+
signing_key:
|
156
|
+
specification_version: 4
|
157
|
+
summary: deploy tool
|
158
|
+
test_files:
|
159
|
+
- spec/provider/azure_webapps_spec.rb
|