Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
DvDty committed Jan 28, 2024
1 parent 8097043 commit 381e9a7
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 21 deletions.
68 changes: 51 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,25 @@ Main focus is to provide the development team strong CI:
- Highly automated
- Fast

| | Push to main | Push on other branches | Pull requests |
|--------------------------------------------------------------------------------------------------------------|--------------|------------------------|---------------|
| [Gitleaks](https://github.com/DvDty/branch-deploy/blob/main/.github/workflows/main-branch-build.yaml#L8-L26) ||||
| [Code linter](https://github.com/DvDty/branch-deploy/blob/main/.github/workflows/main-branch-build.yaml#L28-L64) | | ||
| Build docker image ||||
| Push image to Docker Hub ||| |
| Scan image before pushing || ||
| Unit tests || ||
| Feature tests || ||
| Static code analysis || ||
| Sonar Cloud analysis || ||
| Database migrations || ||
| Check code coverage || ||
| Store code coverage report || | |
| Deploy to minikube || ||
| | Push to main | Push on other branches | Pull requests |
|----------------------------------------------------------------------------------------------------------------------------|--------------|------------------------|---------------|
| [Gitleaks](https://github.com/DvDty/branch-deploy/blob/main/.github/workflows/main-branch-build.yaml#L8-L26) ||||
| [Code linter](https://github.com/DvDty/branch-deploy/blob/main/.github/workflows/main-branch-build.yaml#L28-L64) | | ||
| Build docker image ||||
| Push image to Docker Hub ||| |
| Scan image before pushing || ||
| Unit tests || ||
| Feature tests || ||
| Static code analysis || ||
| Sonar Cloud analysis || ||
| Database migrations || ||
| [Check code coverage](https://github.com/DvDty/branch-deploy/blob/main/.github/workflows/main-branch-build.yaml#L198-L210) || ||
| [Store code coverage report](https://github.com/DvDty/branch-deploy/blob/main/.github/workflows/main-branch-build.yaml#L198-L210) || | |
| Deploy to minikube || ||


### Gitleaks

Example with leaked api key:

![img.png](img.png)
Expand All @@ -39,9 +40,42 @@ Notification in slack:
![img_1.png](img_1.png)

### Code linter

![img_3.png](img_3.png)

![img_2.png](img_2.png)

### Code coverage

![img_4.png](img_4.png)


## Control plane

The control plane allow us to easily create instances of our application on demand through a user-friendly interface. The software development life cycle looks like this:

```mermaid
graph TD;
A[New application feature]
--> B[Feature branch]
B --> |branch-builds.yaml| V
B --> |pull-requests.yaml| C[Pull request to main]
C --> |main-branch-build.yaml| Z
Z[Main branch]
Z --> X
X(docker_image:main)
V(docker_image:branch)
K[Docker Hub]
V --> K
X --> K
N[Control Plane]
K --> N
M[Deployment]
L[Deployment]
P[Deployment]
N --> M
N --> L
N --> P
```

![img_3.png](img_3.png)

![img_4.png](img_4.png)
4 changes: 2 additions & 2 deletions application/k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Deployment
metadata:
name: branch-deploy-application
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: branch-deploy-application
Expand All @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: branch-deploy-application
image: dvdty/branch-deploy-application:latest
image: dvdty/branch-deploy-application:test
imagePullPolicy: "Always"
ports:
- containerPort: 80
4 changes: 3 additions & 1 deletion master/app/Kubectl.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ class Kubectl
{
public function getDeployments(): Collection
{
$json = Process::run('kubectl get deployments --output=json')->output();
$json = Process::run('kubectl get deployments --output=json')
->throw()
->output();

$json = json_decode($json, true);

Expand Down
2 changes: 1 addition & 1 deletion master/k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Deployment
metadata:
name: branch-deploy-master
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: branch-deploy-master
Expand Down

0 comments on commit 381e9a7

Please sign in to comment.