Sha256: e1369ef1fc9cf75e912b63b0a9f66324487a450b640bbb9c247abba759384b06

Contents?: true

Size: 1.5 KB

Versions: 70

Compression:

Stored size: 1.5 KB

Contents

module DPL
  class Provider
    class AzureWebApps < Provider
      def config
        {
          "username"     => options[:username] || context.env['AZURE_WA_USERNAME'],
          "password"     => options[:password] || context.env['AZURE_WA_PASSWORD'],
          "site"         => options[:site] || context.env['AZURE_WA_SITE'],
          "slot"         => options[:slot] || context.env['AZURE_WA_SLOT']
        }
      end

      def git_target
        "https://#{config['username']}:#{config['password']}@#{config['slot'] || config['site']}.scm.azurewebsites.net:443/#{config['site']}.git"
      end

      def needs_key?
        false
      end

      def check_app
      end

      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

      def push_app
        log "Deploying to Azure Web App '#{config['slot'] || config['site']}'"

        if !!options[: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 !!options[:verbose]
          context.shell "git push --force --quiet #{git_target} HEAD:master"
        else
          context.shell "git push --force --quiet #{git_target} HEAD:master > /dev/null 2>&1"
        end
      end
    end
  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
dpl-1.8.20.travis.1655.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.19 lib/dpl/provider/azure_webapps.rb
dpl-1.8.19.travis.1652.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.19.travis.1649.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.19.travis.1647.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.19.travis.1646.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.19.travis.1619.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.19.travis.1576.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.19.travis.1574.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.19.travis.1566.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.18 lib/dpl/provider/azure_webapps.rb
dpl-1.8.18.travis.1564.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.18.travis.1563.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.18.travis.1561.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.18.travis.1558.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.18.travis.1553.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.18.travis.1552.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.18.travis.1551.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.18.travis.1544.3 lib/dpl/provider/azure_webapps.rb
dpl-1.8.18.travis.1543.3 lib/dpl/provider/azure_webapps.rb