-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
1,685 additions
and
397 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
cicd/version | ||
docs/themes/hextra | ||
src/helm/azure-pipelines-agent/templates | ||
*.enc.json | ||
cicd/version/ | ||
docs/public/ | ||
docs/themes/hextra/ | ||
src/helm/blue-agent/templates/ |
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,3 @@ | ||
creation_rules: | ||
- age: age1up54yhdjs672usk4etmy8naa5uh0qamy5tn3nmkwua5vp6fn7v7qz80945 | ||
encrypted_regex: value |
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,10 @@ | ||
{ | ||
"recommendations": [ | ||
"editorconfig.editorconfig", | ||
"ms-azure-devops.azure-pipelines", | ||
"ms-azuretools.vscode-bicep", | ||
"ms-azuretools.vscode-docker", | ||
"ms-kubernetes-tools.vscode-kubernetes-tools", | ||
"snyk-security.snyk-vulnerability-scanner" | ||
] | ||
} |
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,5 @@ | ||
{ | ||
"yaml.schemas": { | ||
"https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json": "test/pipeline/*.yaml" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,24 +1,79 @@ | ||
.PHONY: test lint build-docker docs build-docs | ||
|
||
# Required parameters | ||
flavor ?= null | ||
version ?= null | ||
# Dynamic parameters | ||
prefix ?= $(shell hostname | tr '[:upper:]' '[:lower:]' | tr '.' '-') | ||
deployment_name ?= $(prefix)-$(flavor) | ||
# Deployment outputs | ||
job_name ?= $(shell az deployment sub show --name '$(deployment_name)' | yq '.properties.outputs["jobName"].value') | ||
rg_name ?= $(shell az deployment sub show --name '$(deployment_name)' | yq '.properties.outputs["rgName"].value') | ||
|
||
test: | ||
@echo "➡️ Running Prettier..." | ||
@echo "➡️ Running Prettier" | ||
npx --yes [email protected] --editorconfig --check . | ||
|
||
@echo "➡️ Running Hadolint..." | ||
@echo "➡️ Running Hadolint" | ||
find . -name "Dockerfile*" -exec bash -c "echo 'File {}:' && hadolint {}" \; | ||
|
||
@echo "➡️ Running Azure Bicep Validate" | ||
az deployment sub validate \ | ||
--location westeurope \ | ||
--no-prompt \ | ||
--parameters test/bicep/lint.example.json \ | ||
--template-file src/bicep/main.bicep \ | ||
--verbose | ||
|
||
lint: | ||
@echo "➡️ Running Prettier..." | ||
@echo "➡️ Running Prettier" | ||
npx --yes [email protected] --editorconfig --write . | ||
|
||
@echo "➡️ Running Hadolint..." | ||
@echo "➡️ Running Hadolint" | ||
find . -name "Dockerfile*" -exec bash -c "echo 'File {}:' && hadolint {}" \; | ||
|
||
@echo "➡️ Running Bicep lint" | ||
az bicep lint \ | ||
--file src/bicep/main.bicep \ | ||
--verbose | ||
|
||
deploy-bicep: | ||
@echo "➡️ Decrypting Bicep parameters" | ||
sops -d test/bicep/test.enc.json > test/bicep/test.json | ||
|
||
@echo "➡️ Deploying Bicep" | ||
az deployment sub create \ | ||
--location westeurope \ | ||
--name $(deployment_name) \ | ||
--no-prompt \ | ||
--parameters \ | ||
test/bicep/test.json \ | ||
imageFlavor=$(flavor) \ | ||
imageVersion=$(version) \ | ||
--template-file src/bicep/main.bicep | ||
|
||
@echo "➡️ Cleaning up Bicep parameters" | ||
rm test/bicep/test.json | ||
|
||
@echo "➡️ Starting init job" | ||
az containerapp job start \ | ||
--name $(job_name) \ | ||
--resource-group $(rg_name) | ||
|
||
destroy-bicep: | ||
@echo "➡️ Destroying" | ||
az group delete \ | ||
--name "$(rg_name)" \ | ||
--yes | ||
|
||
integration: | ||
@bash test/integration.sh $(prefix) $(flavor) $(version) $(job_name) | ||
|
||
docs: | ||
cd docs && hugo server | ||
|
||
build-docker: | ||
bash cicd/docker-build-local.sh | ||
@bash cicd/docker-build-local.sh | ||
|
||
build-docs: | ||
cd docs && hugo --gc --minify |
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
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
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,26 @@ | ||
--- | ||
title: Deploy on Azure with Bicep | ||
--- | ||
|
||
Bicep is a deployment language for Azure, allowing to easily deploy resources on the cloud. | ||
|
||
#### Bicep parameters | ||
|
||
| Parameter | Description | Default | | ||
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------ | | ||
| `autoscalingMaxReplicas` | Maximum number of simultaneous jobs the agent can run | `100` | | ||
| `autoscalingMinReplicas` | Minimum number of replicas the agent should have | `0` | | ||
| `extraEnv` | Extra environment variables to pass to the agent | `[]` | | ||
| `imageFlavor` | Flavor of the container image, represents the Linux distribution. Allowed values: `bookworm`, `bullseye`, `focal`, `jammy`, `ubi8`, `ubi9` | `bookworm` | | ||
| `imageName` | Name of the container image | `clemlesne/blue-agent` | | ||
| `imageRegistry` | Registry of the container image. Allowed values: `docker.io`, `ghcr.io` | `ghcr.io` | | ||
| `imageVersion` | Version of the container image, it is recommended to use a specific version like "1.0.0" instead of "latest" | `main` | | ||
| `instance` | Name of the instance, will be used to build the name of the resources | Value from `deployment().name` | | ||
| `location` | Location of resources | `westeurope` | | ||
| `pipelinesCapabilities` | Capabilities of the agent | `['arch_x64']` | | ||
| `pipelinesOrganizationURL` | URL of the Azure DevOps organization | _None_ | | ||
| `pipelinesPersonalAccessToken` | Personal access token allowing the agent to connect to the Azure DevOps organization. This parameter is secure. | _None_ | | ||
| `pipelinesPoolName` | Name of the Azure Pipelines self-hosted pool the agent should be added to | _None_ | | ||
| `pipelinesTimeout` | Timeout in seconds for the agent to run a job before it is automatically terminated | `3600` | | ||
| `resourcesCpu` | Number of CPU cores allocated to the agent | `2` | | ||
| `resourcesMemory` | Amount of memory allocated to the agent | `4Gi` | |
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
Oops, something went wrong.