Skip to content

Commit 3b7b701

Browse files
authored
feat: Add --gen2 support (#172)
1 parent 64ead93 commit 3b7b701

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

function-maven-plugin/src/main/java/com/google/cloud/functions/plugin/DeployFunction.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,12 @@ public class DeployFunction extends CloudSdkMojo {
212212
*/
213213
@Parameter(alias = "deploy.buildenvvarsfile", property = "function.deploy.buildenvvarsfile")
214214
String buildEnvVarsFile;
215-
215+
/**
216+
* If true, deploys the function in the 2nd Generation Environment.
217+
*/
218+
@Parameter(alias = "deploy.gen2", property = "function.deploy.gen2", defaultValue = "false")
219+
boolean gen2;
220+
216221
boolean hasEnvVariables() {
217222
return (this.environmentVariables != null && !this.environmentVariables.isEmpty());
218223
}
@@ -287,6 +292,9 @@ public List<String> getCommands() {
287292
commands.add("functions");
288293
commands.add("deploy");
289294
commands.add(name);
295+
if (gen2) {
296+
commands.add("--gen2");
297+
}
290298
if (region != null) {
291299
commands.add("--region=" + region);
292300
}

0 commit comments

Comments
 (0)