Skip to content

Commit

Permalink
Docs updates and chart name overrides with rollback settings (#57)
Browse files Browse the repository at this point in the history
* Updated references and links

* Add exclude from rollback settings

* Update AWS configuration

* Add override for each chart name
  • Loading branch information
greggbjensen authored Aug 16, 2024
1 parent bcd5aeb commit b272e0e
Show file tree
Hide file tree
Showing 18 changed files with 221 additions and 86 deletions.
2 changes: 1 addition & 1 deletion charts/prdeploy-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ image:
tag: ""

nameOverride: ""
fullnameOverride: ""
fullnameOverride: "prdeploy-api"

podAnnotations: {}

Expand Down
2 changes: 1 addition & 1 deletion charts/prdeploy-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ image:
tag: ""

nameOverride: ""
fullnameOverride: ""
fullnameOverride: "prdeploy-app"

podAnnotations: {}

Expand Down
24 changes: 0 additions & 24 deletions charts/prdeploy-webhooks/common.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion charts/prdeploy-webhooks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ image:
tag: ""

nameOverride: ""
fullnameOverride: ""
fullnameOverride: "prdeploy-webhooks"

podAnnotations: {}

Expand Down
1 change: 1 addition & 0 deletions charts/prdeploy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ global:
secretName: prdeploy-tls
aws:
region: us-west-2
secretPathPrefix: /prdeploy
image:
registry: greggbjensen
serviceAccounts:
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/1-github-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ Workflow run
4. From the drop down, choose each repository you want to use **prdeploy** with.
5. Click **Install**.

[Next step - 2. GitHub OAuth App](getting-started/2-github-oauth-app.md)
[Next step - 2. GitHub OAuth App](./2-github-oauth-app.md)
2 changes: 1 addition & 1 deletion docs/getting-started/2-github-oauth-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ For authorization of the portal to view deployments, we need to create an GitHub
3. Download and select the file from `https://github.com/greggbjensen/prdeploy/blob/main/docs/assets/images/logo-128x128.png`.
4. Click **Update application**.

[Next step - 3. Slack App](getting-started/3-slack-app.md)
[Next step - 3. Slack App](./3-slack-app.md)
2 changes: 1 addition & 1 deletion docs/getting-started/3-slack-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ users:read.email
5. Click on **Allow**.
6. Copy both Webhook URLS to your notes for the **prdeloy** portal settings.

[Next step - 4. Jira Integration](getting-started/4-jira-integration.md)
[Next step - 4. Jira Integration](./4-jira-integration.md)
2 changes: 1 addition & 1 deletion docs/getting-started/4-jira-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ When a pull request is create the prdeploy app will check the branch name for an
6. Enter the **Label** of `prdeloy` and click **Create**.
7. Copy the API token to your notes for the **prdeloy** portal settings.

[Next step - 5. AWS Configuration](getting-started/5-aws-configuration.md)
[Next step - 5. AWS Configuration](./5-aws-configuration.md)
8 changes: 5 additions & 3 deletions docs/getting-started/5-aws-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ The **prdeploy** app loads external secrets, saves settings, and tracks deployme
| ------------------------------------ | ----------------------------------------------------------------------- |
| /prdeploy/APP_ID | ID from GitHub App. |
| /prdeploy/WEBHOOK_SECRET | Webhook secret configured for GitHub App. |
| /prdeploy/gh_app_key.pem | Secret app key downloaded from GitHub App. |
| /prdeploy/gh_app_key.pem | Secret app key downloaded from GitHub App, copy and paste contents. |
| /prdeploy/GitHubAuth\_\_ClientId | Client ID for GitHub OAuth App. |
| /prdeploy/GitHubAuth\_\_ClientSecret | Client Secret for GitHub OAuth App. |
| /prdeploy/Jwt\_\_Key | Generated JWT validation key. |
| /prdeploy/Jwt\_\_TokenEncryptionKey | Generated JWT token encryption key.<br>Should not be the same as above. |

`NOTE:` To generate a unique encryption key, you can run the following:
`NOTE:` To generate a unique JWT and encryption key, you can run the following:

```bash
node -e "console.log(require('crypto').randomBytes(256).toString('base64'));"
```
```

[Next step - 6. prdeploy portal](./6-prdeploy-portal.md)
71 changes: 29 additions & 42 deletions docs/getting-started/6-prdeploy-portal.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,40 @@
The web portal for **prdeploy** allows you to view and manage settings and deployments. These are the installation instructions for Kubernetes.

Each repository can have it's own set of environments and services that **prdeploy** manages. Here is how to configure those settings.
## 1. Helm chart install

## AWS configuration

1. Create the following IAM policy as `prdeploy-backend`:

```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ssm:PutParameter",
"ssm:GetParametersByPath",
"ssm:GetParameter"
],
"Resource": [
"arn:aws:ssm:{{AWS_REGION}}:{{AWS_ACCOUNT_ID}}:parameter//prdeploy/*"
]
}
]
}
1. Install the prerequists in Kubernetes:
1. [ingress-nginx](https://kubernetes.github.io/ingress-nginx/deploy/#quick-start)
2. [cert-manager with letsencrypt](https://medium.com/@manojit123/lets-encrypt-certificate-using-cert-manager-on-kubernetes-http-challenge-687ce3718baf)
3. [external-secrets](https://external-secrets.io/v0.4.3/guides-getting-started/)
2. Create a new file `prdeploy-values.yaml` and add the following content:

```yaml
global:
ingress:
host: prdeploy.myorg.com
aws:
region: us-west-2
serviceAccounts:
backend:
annotations:
eks.amazonaws.com/role-arn: '<Role ARN of prdeploy-backend from AWS Configuration>'

chart-prdeploy-app:
github:
oauth:
clientId: '<GitHub App OAuth Client ID>'
```
2. Add the following entries as `SecureString` to AWS Parameter Store:

| Name | Value |
| ------------------------------------ | ----------------------------------------------------------------------- |
| /prdeploy/APP_ID | ID from GitHub App. |
| /prdeploy/WEBHOOK_SECRET | Webhook secret configured for GitHub App. |
| /prdeploy/gh_app_key.pem | Secret app key downloaded from GitHub App. |
| /prdeploy/GitHubAuth\_\_ClientId | Client ID for GitHub OAuth App. |
| /prdeploy/GitHubAuth\_\_ClientSecret | Client Secret for GitHub OAuth App. |
| /prdeploy/Jwt\_\_Key | Generated JWT validation key. |
| /prdeploy/Jwt\_\_TokenEncryptionKey | Generated JWT token encryption key.<br>Should not be the same as above. |

`NOTE:` To generate a unique encryption key, you can run the following:
2. Run the following command with helm:
```bash
node -e "console.log(require('crypto').randomBytes(256).toString('base64'));"
helm upgrade prdeploy oci://registry-1.docker.io/greggbjensen/prdeploy \
--install --reset-values --force --create-namespace -n prdeploy \
-f ./prdeploy-values.yaml
```

## Helm chart install

1. Install the prerequists in Kubernetes:

1. ingress-nginx
2. cert-manager with letsencrypt
3. External secrets
## 2. Settings

_NOTE: For effeciency settings cache only updates every 5 minutes._

Expand All @@ -66,3 +51,5 @@ node -e "console.log(require('crypto').randomBytes(256).toString('base64'));"

5. Go to **Settings** and **General** for your repository and check `Always suggest updating pull request branches` to get the pull request **Update** button.
1. This makes it much easier to update your pull requests to latest before deploying.

[Next step - 7. GitHub Actions](./7-github-actions.md)
12 changes: 7 additions & 5 deletions docs/getting-started/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ Here is how to get started by configuring your GitHub organization with a GitHub

## Setup steps

1. [GitHub App](1-github-app.md) - Webhooks for responding to GitHub events.
2. [GitHub OAuth App](2-github-oauth-app.md) - Authentication for accessing deployment portal.
3. [Slack App](3-slack-app.md) - Post notifications for deployments and releases.
4. [Repo config](4-repo-config.md) - Configure your repository with environments and services.
5. [GitHub Actions](5-github-actions.md) - A combined deploy that intuitively promotes services in a single workflow.
1. [GitHub App](./1-github-app.md) - Webhooks for responding to GitHub events.
2. [GitHub OAuth App](./2-github-oauth-app.md) - Authentication for accessing deployment portal.
3. [Slack App](./3-slack-app.md) - Post notifications for deployments and releases.
4. [Repo config](./4-jira-integration.md) - Configure your repository with environments and services.
5. [AWS Configuration](./5-aws-configuration.md) - External secrets, save settings, and track deployment versions through AWS parameter store.
6. [prdeploy portal](./6-prdeploy-portal.md) - The web portal that allows you to view and manage settings and deployments.
7. [GitHub Actions](./7-github-actions.md) - A combined deploy that intuitively promotes services in a single workflow.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<dx-popup
[width]="450"
[height]="210"
[showTitle]="true"
title="Add Service to Exclude from Rollback"
[dragEnabled]="false"
[hideOnOutsideClick]="true"
[showCloseButton]="true"
container=".dx-viewport"
[(visible)]="visible"
(visibleChange)="onVisibleChange()">
<div class="form">
<div class="dx-field">
<div class="dx-field-label">Name</div>
<div class="dx-field-value">
<dx-text-box [(value)]="name"></dx-text-box>
</div>
</div>

<div class="actions">
<dx-button class="cancel-btn" text="Cancel" type="normal" (onClick)="cancel()" height="40"> </dx-button>
<dx-button class="deploy-btn" text="Add" type="default" (onClick)="add()" height="40"> </dx-button>
</div>
</div>
</dx-popup>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.actions {
margin-top: 30px;
display: flex;
margin-left: auto;

dx-button {
margin-left: 15px;
}
}

.form {
display: flex;
flex-direction: column;
}

.dx-field {

.dx-field-label {
width: 30%;
}

.dx-field-value {
width: 70%;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
import { DxButtonModule, DxPopupModule, DxTextBoxModule } from 'devextreme-angular';

@Component({
selector: 'app-add-exclude-rollback-service-dialog',
standalone: true,
imports: [DxPopupModule, DxButtonModule, DxTextBoxModule],
templateUrl: './add-exclude-rollback-service-dialog.component.html',
styleUrl: './add-exclude-rollback-service-dialog.component.scss'
})
export class AddExcludeRollbackServiceDialogComponent {
@Output() visibleChange = new EventEmitter<boolean>();
@Output() addInput = new EventEmitter<string>();

name = '';

private _visible = false;

get visible() {
return this._visible;
}

@Input()
set visible(value: boolean) {
this._visible = value;
this.clearFields();
}

constructor(private _changeDetectorRef: ChangeDetectorRef) {}

clearFields() {
this.name = '';
}

onVisibleChange(): void {
this.visibleChange.emit(this.visible);
}

add(): void {
if (!this.name) {
return;
}

this.addInput.emit(this.name);
this.visible = false;
this._changeDetectorRef.detectChanges();
}

cancel(): void {
this.visible = false;
this._changeDetectorRef.detectChanges();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,30 @@ <h4 class="field-group-title">General</h4>
<dx-check-box [(value)]="environment.requireBranchUpToDate" [disabled]="!hasEnvironments"></dx-check-box>
</div>
</div>
<div class="add-items">
<span>Exclude from rollback</span>
<dx-button
class="add-item-input-btn success-icon-btn exclude-rollback"
icon="add"
stylingMode="text"
(onClick)="showAddExcludeRollbackService()"
hint="Add service to exclude"
[disabled]="!hasEnvironments"></dx-button>
</div>
@for (item of environment.excludeFromRollback; track item) {
<div class="field exclude-rollback-field">
<label>{{ item }}</label>
<div class="field-value field-removable">
<dx-button
class="add-workflow-input-btn danger-icon-btn"
icon="remove"
stylingMode="text"
(onClick)="removeExcludeRollbackService(item)"
hint="Remove service to exclude"
[disabled]="!hasEnvironments"></dx-button>
</div>
</div>
}
</div>

<div class="field-group field-group-horizontal">
Expand All @@ -47,11 +71,11 @@ <h4 class="field-group-title">Automation Test</h4>
<dx-text-box [(value)]="environment.automationTest.workflow" [disabled]="!hasEnvironments"></dx-text-box>
</div>
</div>
<div class="test-workflow-inputs">
<div class="add-items">
<div>
<span>Workflow Inputs:</span>
<span>Workflow inputs</span>
<dx-button
class="add-workflow-input-btn success-icon-btn"
class="add-item-input-btn success-icon-btn"
icon="add"
stylingMode="text"
(onClick)="showAddAutomationInput()"
Expand Down Expand Up @@ -83,3 +107,7 @@ <h4 class="field-group-title">Automation Test</h4>
<app-add-automation-input-dialog
[(visible)]="addAutomationInputVisible"
(addInput)="addAutomationInput($event)"></app-add-automation-input-dialog>

<app-add-exclude-rollback-service-dialog
[(visible)]="addExcludeRollbackServiceVisible"
(addInput)="addExcludeRollbackService($event)"></app-add-exclude-rollback-service-dialog>
Loading

0 comments on commit b272e0e

Please sign in to comment.