Sha256: 8b3054dd41e76bb6e04512711bbee88bc650fb7affffd8e9d8460b1931dad271

Contents?: true

Size: 1.14 KB

Versions: 11

Compression:

Stored size: 1.14 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']
        }
      end

      def git_target
        "https://#{config['username']}:#{config['password']}@#{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['site']}'"

        if !!options[:quiet]
          context.shell "git push --force --quiet #{git_target} master > /dev/null 2>&1"
        else
          context.shell "git push --force --quiet #{git_target} master"
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
dpl-1.8.2.travis.1075.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.2.travis.1071.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.1 lib/dpl/provider/azure_webapps.rb
dpl-1.8.1.travis.1070.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.1.travis.1063.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.0 lib/dpl/provider/azure_webapps.rb
dpl-1.7.23.travis.1061.4 lib/dpl/provider/azure_webapps.rb
dpl-1.7.23.travis.1059.4 lib/dpl/provider/azure_webapps.rb
dpl-1.7.22 lib/dpl/provider/azure_webapps.rb
dpl-1.7.22.travis.1058.4 lib/dpl/provider/azure_webapps.rb
dpl-1.7.22.travis.1057.4 lib/dpl/provider/azure_webapps.rb