From e50a0f38ddb5f7d900cc78841d52ece7d49f9e06 Mon Sep 17 00:00:00 2001 From: gitcommitshow <56937085+gitcommitshow@users.noreply.github.com> Date: Fri, 9 Aug 2024 12:41:08 +0530 Subject: [PATCH] chore: docker deployment using dockerhub image (#36) --- README.md | 14 +++++++------- build/docker-compose.yml | 13 +++++++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 build/docker-compose.yml diff --git a/README.md b/README.md index 6b6a072..5c216c3 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,10 @@ A Node.js server for GitHub app to assist external contributors and save maintai ## Roadmap -- [x] When an external contributor (not the internal team) raises a PR, post a comment to sign CLA and label PR `Pending CLA`` -- [x] On signing CLA, remove `Pending CLA`` label and never ask that user to sign the CLA again on any of our repo in future [DONE] -- [x] On `rudder-transformer`` PR merge, post a comment to raise PR in `integrations-config` -- [ ] On `integrations-config`` PR merge, psot a comment to join Slack's product-releases channel to get notified when that integration goes live +- [x] When an external contributor (not the internal team) raises a PR, post a comment to sign CLA and label PR `Pending CLA` +- [x] On signing CLA, remove `Pending CLA` label and never ask that user to sign the CLA again on any of our repo in future +- [x] On `rudder-transformer` PR merge, post a comment to raise PR in `integrations-config` +- [ ] On `integrations-config` PR merge, psot a comment to join Slack's product-releases channel to get notified when that integration goes live ## Requirements @@ -34,12 +34,12 @@ A Node.js server for GitHub app to assist external contributors and save maintai 1. [Register a GitHub app](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app) for your GitHub organization. Make sure to activate the webhook with webhook url `https://YOUR_WEBSITE/api/webhook` in your app with a secret. Enable Permissions & Events as you may need, at minimum pull_request and issue related events should be enabled. 2. Install your GitHub app in all the repos where you need this app. -3. Clone this repo +3. Clone this repo OR download the [`build/docker-compose.yml`](./build/docker-compose.yml) to install via dockerhub image 4. Update `docker-compose.yml` environment variables with the details received from the step 2 > To convert GitHub App's private key to base64, use this command - `openssl base64 -in /path/to/original-private-key.pem -out ./base64EncodedKey.txt -A` 5. Run `docker-componse build` to build the service 6. Run `docker-compose up` to create and start the container -7. Test by visiting `http://localhost:3000` +7. Test by visiting `http://localhost:3000` OR whatever `WEBSITE_ADDRESS` environment variable you've configured ## Usage @@ -60,4 +60,4 @@ by major cloud providers: [Azure Key Vault](https://learn.microsoft.com/en-us/azure/key-vault/secrets/quick-create-node?tabs=windows), [AWS Secrets Manager](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-secrets-manager/), [Google Secret Manager](https://cloud.google.com/nodejs/docs/reference/secret-manager/latest), -etc. +etc. \ No newline at end of file diff --git a/build/docker-compose.yml b/build/docker-compose.yml new file mode 100644 index 0000000..720433d --- /dev/null +++ b/build/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3' +services: + app: + image: gitcommitshow/rudder-github-app + ports: + - "3000:3000" + environment: + - NODE_ENV=production + - PORT=3000 + - APP_ID=11111 # Replace this with your app id. You'll need to create a github app for this: https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app + - GITHUB_APP_PRIVATE_KEY_BASE64=your_github_app_private_key_base64_encode # Replace this. First, get the private key from `GitHub Settings > Developer settings > GitHub Apps > {Your GitHub App} > Private Keys > Click(Generate Private Key)`. And then encode it to base64 using this command: `openssl base64 -in /path/to/original-private-key.pem -out ./base64EncodedKey.txt -A` + - WEBHOOK_SECRET=the_secret_you_configured_for_webhook_in_your_github_app # Replace this + - WEBSITE_ADDRESS=http://localhost:3000 # Replace this with your website domain name. It is recommended to use https, make sure to forward your your traffic on 443 to 3000 port(or whatever you configured earlier in environment.PORT) using reverse proxy such as nginx. \ No newline at end of file