This is a personal work in progress.
Your repo as an auto-helm upgrade or k8s-apply pipeline.
- Semantic Versioning: Semantic-Release
- Dockerfile linter: Hadolint
- Static docerfile analysis: Trivy
- Static code analysis: SonarQube
This pipeline assumes you have just 3
types of repositories:
Name | Short | Description |
---|---|---|
Application | app | Front-end application with internet-facing ingress |
Service | svc | Microservice that may - or may not - have ingress |
Infrastructure as Code | iac | Code that generates cloud infrastructure |
Those repositories must obey a name pattern.
{ecosystem}-{type}-{name/client/integration}
Examples:
ff-svc-clients
: microservice that manages clients' dataff-app-budget
: application that organizes the company financesff-iac-aws
: iac code to manage the aws environment
Your repository need to implement:
name: My pipeline
on: ['push', 'pull_request']
jobs:
Service:
uses: filipeforattini/ff-iac-github-actions/.github/workflows/service.yml@main
with:
containerRegistry: ghcr.io
Name | Default | Description |
---|---|---|
containerRegistry | ghcr.io | Container registry host that you will use |
Configure your
Organizes the whole workflow jobs' inputs.
- Checkout your code and few tools from this repo.
- Configure repository environments.
- List all environments
- for (env in [dev, stg, sbx, prd, dry]): 1.
- List all environments
- Runs scrappers to extract information from your repository and environment keys.
- (TODO) Updates repository configs
- (TODO) Create environments
- Define which path should this build go.
- if [ event_name = push ]
- Build your repository. Supported: nodejs, python
- Checkout your code and few tools from this repo again.
- Define few variables for your build
- Install version
- Loads cache that matches with your repository organization
- Install dependencies
- Runs few scripts
- Generates a .dockerignore, if there isn't one
- Generates a dockerfile, if there isn't one
- Setups docker builder
- Log-in into your Container Registry
- Builds and push the container
- Deploy your container into your DEV environment
- Build your repository. Supported: nodejs, python
- if [ event_name = pull_request ]
- Code quality check
- Checkout your code and few tools from this repo again.
- Define few variables for your build
- Team approval
- Code quality check
git commit -m "action(scope): subject"
Where the actions:
feat
: new feature for the user, not a new feature for the build scriptfix
: bug fix for the user, not a fix for a build scriptdocs
: documentation changesstyle
: formatting, lack of semicolons, etc; no changes to the production coderefactor
: refactoring the production code, for example. renaming a variabletest
: adding missing tests, refactoring tests; no changes to the production codechore
:updating grunted tasks, etc; no changes to the production code
Adds BREAKING CHANGE
in the commit message and it will generate a new major version.
gpg -v \
--symmetric \
--cipher-algo AES256 \
--output ./manifests/secrets/dev.gpg \
./manifests/secrets/dev.env