Class: DPL::Provider::AzureWebApps
- Inherits:
-
DPL::Provider
- Object
- DPL::Provider
- DPL::Provider::AzureWebApps
- Defined in:
- lib/dpl/provider/azure_webapps.rb
Instance Method Summary collapse
- #check_app ⇒ Object
- #check_auth ⇒ Object
- #config ⇒ Object
- #git_target ⇒ Object
- #needs_key? ⇒ Boolean
- #push_app ⇒ Object
Instance Method Details
#check_app ⇒ Object
21 22 |
# File 'lib/dpl/provider/azure_webapps.rb', line 21 def check_app end |
#check_auth ⇒ Object
24 25 26 27 28 |
# File 'lib/dpl/provider/azure_webapps.rb', line 24 def check_auth error "missing Azure Git Deployment username" unless config['username'] error "missing Azure Git Deployment password" unless config['password'] error "missing Azure Web App name" unless config['site'] end |
#config ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/dpl/provider/azure_webapps.rb', line 4 def config { "username" => [:username] || context.env['AZURE_WA_USERNAME'], "password" => [:password] || context.env['AZURE_WA_PASSWORD'], "site" => [:site] || context.env['AZURE_WA_SITE'], "slot" => [:slot] || context.env['AZURE_WA_SLOT'] } end |
#git_target ⇒ Object
13 14 15 |
# File 'lib/dpl/provider/azure_webapps.rb', line 13 def git_target "https://#{config['username']}:#{config['password']}@#{config['slot'] || config['site']}.scm.azurewebsites.net:443/#{config['site']}.git" end |
#needs_key? ⇒ Boolean
17 18 19 |
# File 'lib/dpl/provider/azure_webapps.rb', line 17 def needs_key? false end |
#push_app ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/dpl/provider/azure_webapps.rb', line 30 def push_app log "Deploying to Azure Web App '#{config['slot'] || config['site']}'" if !![:skip_cleanup] log "Skipping Cleanup" context.shell "git checkout HEAD" context.shell "git add . --all --force" context.shell "git commit -m \"Skip Cleanup Commit\"" end if !![:verbose] context.shell "git push --force --quiet #{git_target} HEAD:refs/heads/master" else context.shell "git push --force --quiet #{git_target} HEAD:refs/heads/master > /dev/null 2>&1" end end |