-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Move lib into subdir, init CICD [HOOK FAIL OK]
- Loading branch information
Showing
51 changed files
with
685 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: v2 | ||
name: cicd | ||
description: Tekton pipeline for CI/CD | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.1.0 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "1.16.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Monofolio CICD | ||
|
||
## Goal | ||
|
||
- Create a "beta" version of the Monofolio website that is automatically deployed and is a ref to the `main` branch of the repository. | ||
- Create a "production" version of the Monofolio website that is automatically deployed and is a ref to a `tag` in the repository. | ||
- Make sure that the "production" version is tested in depth | ||
|
||
### Deploy flow | ||
|
||
- Build the Frontend if the folder related to the Frontend has changed. | ||
- apps/front | ||
- libs/front/* | ||
- Build the Backend if the folder related to the Backend has changed. | ||
- apps/back | ||
- libs/back/* | ||
- Push the images to a conteneur registry. | ||
- Deploy the images to a Kubernetes cluster. | ||
|
||
### Test flow | ||
|
||
- Run Code Coverage tests on the Backend | ||
- Run E2E tests on the Frontend | ||
- Run Lighthouse tests on the Frontend | ||
- Run Security tests on both the Backend and the Frontend | ||
|
||
### Deployment flow | ||
|
||
- Write code in a new branch | ||
- Create a Pull Request | ||
- PR is tested by Github Actions then the Test flow is executed. | ||
- If both the Test flow and the PR checks pass, the PR is merged into the `main` branch. | ||
- The Release flow is executed and the `beta` version is deployed. | ||
- If the `beta` version is stable, a new tag is created and the `production` version is deployed. | ||
|
||
```mermaid | ||
flowchart TD; | ||
subgraph "Development flow" | ||
A([Write code in a new branch]) --> B[Create a Pull Request]; | ||
end | ||
subgraph "Test flow" | ||
B --> C[PR is tested by Github Actions]; | ||
C -- If Github Action is ok --> D[Run the Test flow]; | ||
D -- If test nok --> E[PR is locked with information]; | ||
end | ||
subgraph "Release flow" | ||
D -- If test ok --> F[PR is merged into the `main` branch]; | ||
F -- If Front changed --> G[Build the Frontend]; | ||
F -- If Back changed --> H[Build the Backend]; | ||
G --> I[Push the images to a conteneur registry]; | ||
H --> I; | ||
I --> J[Deploy the helm chart]; | ||
end | ||
``` |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: build-image | ||
spec: | ||
description: | | ||
This task builds selected image. | ||
workspaces: | ||
- name: shared-data | ||
description: | | ||
This workspace contains the cloned repo files, so they can be read by the | ||
next task. | ||
- name: dockerconfig | ||
description: | | ||
This workspace contains the docker config.json file, so it can be used by | ||
the next task. | ||
params: | ||
- name: registrydns | ||
type: string | ||
description: The registry dns name. | ||
default: docker.io | ||
- name: buildctl_tcp | ||
type: string | ||
description: The buildctl tcp address. | ||
default: tcp://buildkitd.buildkit.svc.cluster.local:1234 | ||
- name: repo-branch | ||
type: string | ||
description: The git repo branch to clone from. | ||
default: main | ||
- name: path-dockerfile | ||
type: string | ||
description: The folder where the dockerfile are. | ||
default: . | ||
- name: context-dockerfile | ||
type: string | ||
description: The context where the dockerfile are. | ||
default: . | ||
- name: DOCKERFILE | ||
type: string | ||
description: The dockerfile to build. | ||
default: Dockerfile | ||
- name: IMAGE | ||
type: string | ||
description: The image name to build (repo/imagename). | ||
steps: | ||
- image: '{{ .Values.task.buildImage.baseImage }}' | ||
name: build-all | ||
env: | ||
- name: DOCKER_CONFIG | ||
value: $(workspaces.dockerconfig.path) | ||
workingDir: $(workspaces.shared-data.path) | ||
script: | | ||
#!/usr/bin/env ash | ||
buildctl --addr $(params.buildctl_tcp) build --progress=plain --frontend dockerfile.v0 --local context=$(params.context-dockerfile) --local dockerfile=$(params.path-dockerfile) --opt filename=$(params.DOCKERFILE) --output type=image,name=$(params.registrydns)/$(params.IMAGE):$(params.repo-branch),push=true | ||
# https://tekton.dev/docs/pipelines/tasks/#specifying-workspaces |
Oops, something went wrong.