Sha256: d98bd36ee0204d3264fbbe814821680085a89437f6cb77c8fae44b76de332e79

Contents?: true

Size: 1.58 KB

Versions: 12

Compression:

Stored size: 1.58 KB

Contents

# frozen_string_literal: true

module Dpl
  module Providers
    class AzureWebApps < Provider
      register :azure_web_apps

      status :alpha

      full_name 'Azure Web Apps'

      description sq(<<-STR)
        tbd
      STR

      env :AZURE_WA

      opt '--username NAME', 'Web App Deployment Username', required: true
      opt '--password PASS', 'Web App Deployment Password', required: true, secret: true
      opt '--site SITE',     'Web App name (e.g. myapp in myapp.azurewebsites.net)', required: true
      opt '--slot SLOT',     'Slot name (if your app uses staging deployment)'
      opt '--verbose',       'Print deployment output from Azure. Warning: If authentication fails, Git prints credentials in clear text. Correct credentials remain hidden.'

      needs :git

      cmds checkout: 'git checkout HEAD',
           add: 'git add . --all --force',
           commit: 'git commit -m "Cleanup commit"',
           deploy: 'git push --force --quiet %{url} HEAD:refs/heads/master'

      msgs commit: 'Committing changes to git',
           deploy: 'Deploying to Azure Web App: %{site}'

      errs push: 'Failed pushing to Azure Web Apps'

      URL = 'https://%s:%s@%s.scm.azurewebsites.net:443/%s.git'

      def setup
        commit if git_dirty? && !cleanup?
      end

      def deploy
        shell :deploy, silence: !verbose?
      end

      private

      def url
        format(URL, username, password, target, site)
      end

      def target
        slot || site
      end

      def commit
        shell :checkout
        shell :add
        shell :commit
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
dpl-2.0.5.3 lib/dpl/providers/azure_web_apps.rb
dpl-2.0.5.3.beta.1 lib/dpl/providers/azure_web_apps.rb
dpl-2.0.5.2 lib/dpl/providers/azure_web_apps.rb
dpl-2.0.5.2.beta.1 lib/dpl/providers/azure_web_apps.rb
dpl-2.0.5.1 lib/dpl/providers/azure_web_apps.rb
dpl-2.0.5.beta.2.1 lib/dpl/providers/azure_web_apps.rb
dpl-2.0.5.beta.2 lib/dpl/providers/azure_web_apps.rb
dpl-2.0.5 lib/dpl/providers/azure_web_apps.rb
dpl-2.0.5.beta.1 lib/dpl/providers/azure_web_apps.rb
dpl-2.0.5.beta lib/dpl/providers/azure_web_apps.rb
travis_dpl_test-2.0.3.beta.4.ror.1 lib/dpl/providers/azure_web_apps.rb
travis_dpl_test-2.0.3.beta.4.ror lib/dpl/providers/azure_web_apps.rb