Sha256: 6f44edda049a1df45f26617f38a37bf60723a7325080a4c3626e7d4ae918c076

Contents?: true

Size: 730 Bytes

Versions: 18

Compression:

Stored size: 730 Bytes

Contents

module DPL
  class Provider
    class NPM < Provider
      NPMRC_FILE = '~/.npmrc'

      def needs_key?
        false
      end

      def check_app
      end

      def setup_auth
        File.open(File.expand_path(NPMRC_FILE), 'w') do |f|
          f.puts("//registry.npmjs.org/:_authToken=${NPM_API_KEY}")
        end
      end

      def check_auth
        setup_auth
        log "Authenticated with email #{option(:email)}"
      end

      def push_app
        log "NPM API key format changed recently. If your deployment fails, check your API key in ~/.npmrc."
        log "http://docs.travis-ci.com/user/deployment/npm/"
        context.shell "env NPM_API_KEY=#{option(:api_key)} npm publish"
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
dpl-1.7.19.travis.942.4 lib/dpl/provider/npm.rb
dpl-1.7.19.travis.933.4 lib/dpl/provider/npm.rb
dpl-1.7.19.travis.929.4 lib/dpl/provider/npm.rb
dpl-1.7.19.travis.895.4 lib/dpl/provider/npm.rb
dpl-1.7.18.travis.894.4 lib/dpl/provider/npm.rb
dpl-1.7.18 lib/dpl/provider/npm.rb
dpl-1.7.18.travis.890.4 lib/dpl/provider/npm.rb
dpl-1.7.17 lib/dpl/provider/npm.rb
dpl-1.7.17.travis.889.4 lib/dpl/provider/npm.rb
dpl-1.7.17.travis.886.4 lib/dpl/provider/npm.rb
dpl-1.7.17.travis.885.4 lib/dpl/provider/npm.rb
dpl-1.7.17.travis.884.4 lib/dpl/provider/npm.rb
dpl-1.7.17.travis.882.4 lib/dpl/provider/npm.rb
dpl-1.7.17.travis.869.4 lib/dpl/provider/npm.rb
dpl-1.7.17.travis.868.4 lib/dpl/provider/npm.rb
dpl-1.7.17.travis.866.4 lib/dpl/provider/npm.rb
dpl-1.7.16.travis.865.4 lib/dpl/provider/npm.rb
dpl-1.7.16 lib/dpl/provider/npm.rb