Skip to content
This repository has been archived by the owner on Jan 16, 2019. It is now read-only.

Commit

Permalink
updated releasinator
Browse files Browse the repository at this point in the history
  • Loading branch information
sankarbhavanib committed May 11, 2016
1 parent 30f59af commit 583cdca
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions .releasinator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,23 @@ def validate_version_match()
method(:validate_version_match)
]

# there are no separate build steps for PayPal-Cordova-Plugin , so it is just empty method
def build_method
# run tests first
# detect non-zero failures/errors, since ruby command won't exit properly if unit tests called exit/abort
output = CommandProcessor.command("ruby test/ts_allTests.rb | cat", live_output=true)
if !output.match /assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications$/
Printer.fail("There were unit test failures.")
abort()
end

output_dir = "build"
CommandProcessor.command("gem build releasinator.gemspec")
Dir.mkdir(output_dir) unless File.exists?(output_dir)
CommandProcessor.command("mv releasinator-*.gem #{output_dir}")
end

# The command that builds the sdk. Required.
configatron.build_method = method(:build_method)

def publish_to_package_manager(version)
output_dir = "build"
Dir.chdir(output_dir) do
CommandProcessor.command("gem push releasinator-#{version}.gem")
end
CommandProcessor.command("npm publish .")
end

# The method that publishes the sdk to the package manager. Required.
configatron.publish_to_package_manager_method = method(:publish_to_package_manager)


def wait_for_package_manager(version)
CommandProcessor.wait_for("wget -U \"non-empty-user-agent\" -qO- https://www.npmjs.com/package/com.paypal.cordova.mobilesdk#{version} | cat")
CommandProcessor.wait_for("wget -U \"non-empty-user-agent\" -qO- https://www.npmjs.com/package/com.paypal.cordova.mobilesdk |grep @current_release.version | cat")
end

# The method that waits for the package manager to be done. Required
Expand Down

0 comments on commit 583cdca

Please sign in to comment.