Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

No longer adds and commits build artifacts on deploy.

Should be handled by the buildpack compile script.
  • Loading branch information...
commit dfde3e60f14c2ade81b7fa42c79f779c326b5a1c 1 parent ccf0cd7
@marcoVermeulen authored
View
17 src/main/groovy/org/ratpackframework/gradle/HerokuAppDeployTask.groovy
@@ -1,13 +1,10 @@
package org.ratpackframework.gradle
-import org.eclipse.jgit.lib.PersonIdent
+
import org.eclipse.jgit.transport.RefSpec
import org.gradle.api.GradleException
class HerokuAppDeployTask extends HerokuTask {
- static final String AUTHOR_NAME = 'Gradle Heroku plugin'
- static final String AUTHOR_EMAIL = 'invalid@example.org'
- static final String COMMIT_MESSAGE = "Commit generated artifact for heroku deployment."
static final String DEPLOYABLE_ARTIFACT_FOLDER = "build/libs"
static final String REF_SPEC = "master:master"
@@ -28,18 +25,6 @@ class HerokuAppDeployTask extends HerokuTask {
throw new GradleException("No remote $REMOTE_NAME found. First run: \$ gradle herokuAppCreate")
}
- logger.quiet "\nAdding deployable artifacts in $DEPLOYABLE_ARTIFACT_FOLDER to git repo."
- git.add()
- .addFilepattern(DEPLOYABLE_ARTIFACT_FOLDER)
- .call()
-
- logger.quiet "Committing to git."
- def author = new PersonIdent(AUTHOR_NAME, AUTHOR_EMAIL)
- git.commit()
- .setMessage(COMMIT_MESSAGE)
- .setAuthor(author)
- .call()
-
logger.quiet "Pushing to remote repo: $REMOTE_NAME."
logger.quiet "This could take a while... Really."
def refSpec = new RefSpec(REF_SPEC)
View
79 src/test/groovy/org/ratpackframework/gradle/HerokuAppDeploySpec.groovy
@@ -1,10 +1,9 @@
package org.ratpackframework.gradle
-import org.eclipse.jgit.lib.PersonIdent
+
import org.eclipse.jgit.transport.RefSpec
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.testfixtures.ProjectBuilder
-import spock.lang.Ignore
import spock.lang.Specification
class HerokuAppDeploySpec extends Specification {
@@ -51,69 +50,6 @@ class HerokuAppDeploySpec extends Specification {
task.description == "Deploy the application to Heroku."
}
- void "should add build artifacts to git repo"() {
- given:
- def appName = "appName"
-
-
- and: "the build folder is added"
- def filePatternToAdd
- addCommand.addFilepattern = {
- filePatternToAdd = it
- addCommand
- }
-
- and: "the add command is called"
- def called = false
- addCommand.call = {
- called = true
- }
-
- when:
- task.execute([appName: appName])
-
- then:
- called
- filePatternToAdd == "build/libs"
- }
-
- void "should commit build artifacts to git repo"() {
- given:
- def appName = "appName"
-
- and: "the commit message is set"
- def messageSet = false
- commitCommand.setMessage = {
- assert it == "Commit generated artifact for heroku deployment."
- messageSet = true
- commitCommand
- }
-
- and: "the author is set"
- def authorSet = false
- commitCommand.setAuthor = { PersonIdent author ->
- assert author instanceof PersonIdent
- author.emailAddress == 'invalid@example.org'
- author.name == 'Gradle Heroku plugin'
- authorSet = true
- commitCommand
- }
-
- and: "the commit command is called"
- def called = false
- commitCommand.call = {
- called = true
- }
-
- when:
- task.execute([appName: appName])
-
- messageSet
- authorSet
- then:
- called
- }
-
void "should push to git heroku remote"() {
given:
def appName = "appName"
@@ -147,19 +83,6 @@ class HerokuAppDeploySpec extends Specification {
called
}
- @Ignore
- void "should not deploy if build artifacts not present"() {
- given:
- def appName = "appName"
- buildLibs.deleteDir()
-
- when:
- task.execute([appName: appName])
-
- then:
- thrown(GradleException)
- }
-
void "should not deploy if git heroku remote not set"() {
given:
def appName = "appName"
Please sign in to comment.
Something went wrong with that request. Please try again.