From 79b2804bcd98d503fdc301dcd3961327128f4b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Garc=C3=ADa=20Dom=C3=ADnguez?= Date: Wed, 9 Dec 2020 12:23:55 +0100 Subject: [PATCH 1/4] Add recipe for google Stackdriver handler --- .../0.1/config/keys/google_service_account.json | 12 ++++++++++++ .../config/packages/prod/mgdsoft_stackdriver.yaml | 3 +++ mgdsoft/stackdriver-bundle/0.1/manifest.json | 14 ++++++++++++++ mgdsoft/stackdriver-bundle/0.1/post-install.txt | 5 +++++ 4 files changed, 34 insertions(+) create mode 100755 mgdsoft/stackdriver-bundle/0.1/config/keys/google_service_account.json create mode 100644 mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml create mode 100644 mgdsoft/stackdriver-bundle/0.1/manifest.json create mode 100644 mgdsoft/stackdriver-bundle/0.1/post-install.txt diff --git a/mgdsoft/stackdriver-bundle/0.1/config/keys/google_service_account.json b/mgdsoft/stackdriver-bundle/0.1/config/keys/google_service_account.json new file mode 100755 index 00000000..42bb6c2e --- /dev/null +++ b/mgdsoft/stackdriver-bundle/0.1/config/keys/google_service_account.json @@ -0,0 +1,12 @@ +{ + "type": "service_account", + "project_id": "projectid", + "private_key_id": "281379821737219379as87d", + "private_key": "-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----\n", + "client_email": "service@appspot.gserviceaccount.com", + "client_id": "110459080868243513123", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/service%40appspot.gserviceaccount.com" +} diff --git a/mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml b/mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml new file mode 100644 index 00000000..bd0eaca4 --- /dev/null +++ b/mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml @@ -0,0 +1,3 @@ +mgdsoft_stackdriver: + credentials_json_file: "%env(resolve:GOOGLE_SERVICE_ACCOUNT)%'" + level: info diff --git a/mgdsoft/stackdriver-bundle/0.1/manifest.json b/mgdsoft/stackdriver-bundle/0.1/manifest.json new file mode 100644 index 00000000..a5c3cfc3 --- /dev/null +++ b/mgdsoft/stackdriver-bundle/0.1/manifest.json @@ -0,0 +1,14 @@ +{ + "bundles": { + "MGDSoft\\Stackdriver\\MgdsoftStackdriverBundle": ["prod"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + }, + "env": { + "GOOGLE_SERVICE_ACCOUNT": "%kernel.project_dir%/config/keys/google_service_account.json" + }, + "gitignore": [ + "/config/keys/google_service_account.json" + ] +} diff --git a/mgdsoft/stackdriver-bundle/0.1/post-install.txt b/mgdsoft/stackdriver-bundle/0.1/post-install.txt new file mode 100644 index 00000000..9a18293e --- /dev/null +++ b/mgdsoft/stackdriver-bundle/0.1/post-install.txt @@ -0,0 +1,5 @@ + + MGD Stackdriver installed in PROD ENV + + + From 1e9d0c2dbe957ba356ad057ec68f01f41fecf802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Garc=C3=ADa=20Dom=C3=ADnguez?= Date: Wed, 16 Dec 2020 15:50:27 +0100 Subject: [PATCH 2/4] Remove json credentials --- .../0.1/config/keys/google_service_account.json | 12 ------------ .../config/packages/prod/mgdsoft_stackdriver.yaml | 3 ++- mgdsoft/stackdriver-bundle/0.1/manifest.json | 8 +------- 3 files changed, 3 insertions(+), 20 deletions(-) delete mode 100755 mgdsoft/stackdriver-bundle/0.1/config/keys/google_service_account.json diff --git a/mgdsoft/stackdriver-bundle/0.1/config/keys/google_service_account.json b/mgdsoft/stackdriver-bundle/0.1/config/keys/google_service_account.json deleted file mode 100755 index 42bb6c2e..00000000 --- a/mgdsoft/stackdriver-bundle/0.1/config/keys/google_service_account.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "service_account", - "project_id": "projectid", - "private_key_id": "281379821737219379as87d", - "private_key": "-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----\n", - "client_email": "service@appspot.gserviceaccount.com", - "client_id": "110459080868243513123", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/service%40appspot.gserviceaccount.com" -} diff --git a/mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml b/mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml index bd0eaca4..cf0075f2 100644 --- a/mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml +++ b/mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml @@ -1,3 +1,4 @@ mgdsoft_stackdriver: - credentials_json_file: "%env(resolve:GOOGLE_SERVICE_ACCOUNT)%'" + # to test in local + # credentials_json_file: "google_acount_service.json'" level: info diff --git a/mgdsoft/stackdriver-bundle/0.1/manifest.json b/mgdsoft/stackdriver-bundle/0.1/manifest.json index a5c3cfc3..969a6502 100644 --- a/mgdsoft/stackdriver-bundle/0.1/manifest.json +++ b/mgdsoft/stackdriver-bundle/0.1/manifest.json @@ -4,11 +4,5 @@ }, "copy-from-recipe": { "config/": "%CONFIG_DIR%/" - }, - "env": { - "GOOGLE_SERVICE_ACCOUNT": "%kernel.project_dir%/config/keys/google_service_account.json" - }, - "gitignore": [ - "/config/keys/google_service_account.json" - ] + } } From 0dc04ca0307309477671f08e868c2decf1db801c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Garc=C3=ADa=20Dom=C3=ADnguez?= Date: Sat, 19 Dec 2020 03:51:07 +0100 Subject: [PATCH 3/4] default value to null --- .../0.1/config/packages/prod/mgdsoft_stackdriver.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml b/mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml index cf0075f2..0d951a4d 100644 --- a/mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml +++ b/mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml @@ -1,4 +1,4 @@ mgdsoft_stackdriver: # to test in local - # credentials_json_file: "google_acount_service.json'" + # credentials_json_file: ~ level: info From 515df5da2e7d613527b3e25bda61b0b5973b5c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Garc=C3=ADa=20Dom=C3=ADnguez?= Date: Sun, 20 Dec 2020 00:46:16 +0100 Subject: [PATCH 4/4] default value to null --- .../0.1/config/packages/prod/mgdsoft_stackdriver.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml b/mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml index 0d951a4d..22f3d807 100644 --- a/mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml +++ b/mgdsoft/stackdriver-bundle/0.1/config/packages/prod/mgdsoft_stackdriver.yaml @@ -1,4 +1,4 @@ mgdsoft_stackdriver: # to test in local - # credentials_json_file: ~ + # credentials_json_file: null level: info