Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

add verbosity option #429

Merged
merged 3 commits into from
Sep 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file.

## Unreleased
### Added
* `appengine.tools.verbosity` option for defining gcloud log verbosity ([#429](../../pull/429))

## 2.3.0
### Added
* Update to appengine-plugins-core 0.9.0 ([#422](../../pull/422))
Expand Down
7 changes: 5 additions & 2 deletions USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ If you wish to customize your configuration, the plugin can be configured using
| `serviceAccountKeyFile` | A Google project service account key file to run Cloud SDK operations requiring an authenticated user. |
| `cloudSdkHome` | Location of the Cloud SDK. |
| `cloudSdkVersion` | Desired version of the Cloud SDK. (e.g. "192.0.0") |
| `verbosity` | The verbosity level for logging when gcloud is run. See [gcloud docs](https://cloud.google.com/sdk/gcloud/reference#--verbosity) for allowed values. Can be set from the command line using the system property `gcloud.verbosity` |

The Cloud SDK will be installed/updated/verified depending on which parameters are configured:

Expand Down Expand Up @@ -185,8 +186,10 @@ If you wish to customize your configuration, the plugin can be configured using

| Parameter | Description |
| ------------------ | ----------- |
| `cloudSdkHome` | Location of the Cloud SDK. |
| `cloudSdkVersion` | Desired version of the Cloud SDK. (e.g. "192.0.0") |
| `serviceAccountKeyFile` | A Google project service account key file to run Cloud SDK operations requiring an authenticated user. |
| `cloudSdkHome` | Location of the Cloud SDK. |
| `cloudSdkVersion` | Desired version of the Cloud SDK. (e.g. "192.0.0") |
| `verbosity` | The verbosity level for logging when gcloud is run. See [gcloud docs](https://cloud.google.com/sdk/gcloud/reference#--verbosity) for allowed values. Can be set from the command line using the system property `gcloud.verbosity` |

The Cloud SDK will be installed/updated/verified depending on which parameters are configured:

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<dependency>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-plugins-core</artifactId>
<version>0.9.0</version>
<version>0.9.1</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public Gcloud getGcloud() {
return Gcloud.builder(buildCloudSdkMinimal())
.setMetricsEnvironment(mojo.getArtifactId(), mojo.getArtifactVersion())
.setCredentialFile(mojo.getServiceAccountKeyFile())
.setVerbosity(mojo.getVerbosity())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public abstract class CloudSdkMojo extends AbstractMojo {
@Parameter(property = "serviceAccountKeyFile", required = false)
private File serviceAccountKeyFile;

/** Optional parameter to configure the gcloud logging verbosity level. */
@Parameter(property = "gcloud.verbosity")
private String verbosity;

@Parameter(defaultValue = "${plugin}", readonly = true)
protected PluginDescriptor pluginDescriptor;

Expand Down Expand Up @@ -76,6 +80,10 @@ public Path getServiceAccountKeyFile() {
return (serviceAccountKeyFile == null) ? null : serviceAccountKeyFile.toPath();
}

public String getVerbosity() {
return verbosity;
}

public CloudSdkAppEngineFactory getAppEngineFactory() {
return factory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public void testGetGcloud() {
verify(mojoMock).getArtifactId();
verify(mojoMock).getArtifactVersion();
verify(mojoMock).getServiceAccountKeyFile();
verify(mojoMock).getVerbosity();
}

@Test
Expand Down