
com.deploygate.gradle.plugins.entities.DeployGateExtension.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle Show documentation
Show all versions of gradle Show documentation
This is the DeployGate plugin for the Gradle. You can build and deploy your apps to DeployGate by running a single task.
package com.deploygate.gradle.plugins.entities
import com.deploygate.gradle.plugins.Config
import com.deploygate.gradle.plugins.utils.HTTPBuilderFactory
import groovyx.net.http.ContentType
import org.gradle.api.NamedDomainObjectContainer
public class DeployGateExtension {
def String token
def String userName
def String endpoint = Config.DEPLOYGATE_ROOT
def NamedDomainObjectContainer apks
def String notifyKey = null
public DeployGateExtension(NamedDomainObjectContainer apkTargets) {
this.apks = apkTargets
}
public apks(Closure closure) {
apks.configure(closure)
}
def notifyServer(String action, HashMap data = null) {
if (!notifyKey)
return
def query = ['key': notifyKey, 'command_action': action]
if (data)
query = query + data
try {
HTTPBuilderFactory.httpBuilder(endpoint).post path: "/cli/notify",
body: query, requestContentType: ContentType.URLENC
} catch (ignored) {
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy