use of org.curioswitch.gradle.plugins.gcloud.GcloudExtension in project curiostack by curioswitch.
the class GcloudTask method exec.
@TaskAction
public void exec() {
GcloudExtension config = getProject().getRootProject().getExtensions().getByType(GcloudExtension.class);
var toolManager = DownloadedToolManager.get(getProject());
String command = Os.isFamily(Os.FAMILY_WINDOWS) ? COMMAND + ".cmd" : COMMAND;
Path executable = toolManager.getBinDir("gcloud").resolve(command);
List<Object> fullArgs = ImmutableList.builder().add("--project=" + config.getClusterProject().get()).add("--quiet").addAll(args.get().stream().map(o -> o instanceof Provider ? ((Provider) o).get() : o)::iterator).build();
getProject().exec(exec -> {
exec.executable(executable);
exec.args(fullArgs);
toolManager.addAllToPath(exec);
exec.environment("CLOUDSDK_PYTHON", toolManager.getBinDir("miniconda-build").resolve("python"));
exec.environment("CLOUDSDK_PYTHON_SITEPACKAGES", "1");
exec.setStandardInput(System.in);
});
}
Aggregations