Sha256: 5e2e5c8d1f3be71f2d238c401e2c31d1837a39fdecbf11962ccbcad8e36336fe

Contents?: true

Size: 1.49 KB

Versions: 19

Compression:

Stored size: 1.49 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 master"
          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} master"
        else
          context.shell "git push --force --quiet #{git_target} master > /dev/null 2>&1"
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
dpl-1.8.12.travis.1260.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.12.travis.1254.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.12.travis.1244.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.12.travis.1236.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.12.travis.1228.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.12.travis.1226.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.12.travis.1223.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.11 lib/dpl/provider/azure_webapps.rb
dpl-1.8.11.travis.1222.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.11.travis.1218.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.10.travis.1217.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.10 lib/dpl/provider/azure_webapps.rb
dpl-1.8.10.travis.1215.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.9.travis.1214.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.9 lib/dpl/provider/azure_webapps.rb
dpl-1.8.9.travis.1204.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.8.travis.1203.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.8.travis.1202.4 lib/dpl/provider/azure_webapps.rb
dpl-1.8.8 lib/dpl/provider/azure_webapps.rb