Skip to content

Commit

Permalink
add automatic CC support to Google Cloud Support Slackbot (GoogleClou…
Browse files Browse the repository at this point in the history
…dPlatform#984)

* New CC feature

* Fixed typos and updated help message with new CC commands

* Removed duplicate files

* Removed an additional duplicate file

* Fixed folder tracking & README

* Formatting

* Updated README set-up instructions with new permission
  • Loading branch information
auelsayed authored Feb 14, 2023
1 parent 0c11384 commit 5c335de
Show file tree
Hide file tree
Showing 37 changed files with 1,661 additions and 2,000 deletions.
2 changes: 1 addition & 1 deletion tools/google-cloud-support-slackbot/Dockerfile
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
FROM python:3.7-slim AS compile-image
LABEL author="Damian Lance"
LABEL created="2022-01-19"
LABEL last_updated="2022-01-19"
LABEL last_updated="2023-02-08"

RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
Expand Down
9 changes: 8 additions & 1 deletion tools/google-cloud-support-slackbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ The app currently supports the following commands:
* /google-cloud-support list-tracked-cases-all -- lists all cases being tracked in the workspace
* /google-cloud-support case-details [case_number] -- pull all of the case data as json
* /google-cloud-support sitrep -- report of all active cases in the org
* /google-cloud-support auto-subscribe [asset type] [asset name] [email 1] ... [email n] -- creates a subscription to a specific asset that will automatically add the provided emails as CC on any new cases under the asset. Asset type must one of the following values: organizations, folders, projects
* /google-cloud-support edit-auto-subscribe [asset type] [asset name] [email 1] ... [email n] -- edits an existing asset subscription with the provided emails. Warning: this will overwrite the existing emails in the subscription. Asset type must one of the following values: organizations, folders, projects
* /google-cloud-support stop-auto-subscribe [asset type] [asset name] -- deletes an existing asset subscription. Asset type must one of the following values: organizations, folders, projects
* /google-cloud-support list-auto-subscriptions-all -- lists all the subscriptions being in the current channel

**If you encounter any issues with this application's operations or setup, please file your issue here on GitHub or ping a member of your account team for assistance. This application is not supported by the Google Cloud Support team.**

Expand Down Expand Up @@ -94,13 +98,16 @@ gcloud organizations add-iam-policy-binding $ORG_ID \
gcloud organizations add-iam-policy-binding $ORG_ID \
--member="serviceAccount:support-slackbot@$DEVSHELL_PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/resourcemanager.organizationViewer";
gcloud organizations add-iam-policy-binding $ORG_ID \
--member="serviceAccount:support-slackbot@$DEVSHELL_PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/resourcemanager.folderEditor";
gcloud auth configure-docker us-central1-docker.pkg.dev
gcloud artifacts repositories create google-cloud-support-slackbot \
--repository-format=Docker \
--location=us-central1 \
--description="Docker images for the Google Cloud Support Slackbot";
gcloud app create --region=us-central;
gcloud alpha firestore databases create --region=us-central;
gcloud firestore databases create --region=us-central;
docker pull thelancelord/google-cloud-support-slackbot:2.0;
docker tag thelancelord/google-cloud-support-slackbot:2.0 us-central1-docker.pkg.dev/$DEVSHELL_PROJECT_ID/google-cloud-support-slackbot/google-cloud-support-slackbot:2.0;
docker push us-central1-docker.pkg.dev/$DEVSHELL_PROJECT_ID/google-cloud-support-slackbot/google-cloud-support-slackbot:2.0;
Expand Down
10 changes: 0 additions & 10 deletions tools/google-cloud-support-slackbot/archive/README.md

This file was deleted.

24 changes: 0 additions & 24 deletions tools/google-cloud-support-slackbot/archive/standalone/default

This file was deleted.

Loading

0 comments on commit 5c335de

Please sign in to comment.