Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 50 additions & 51 deletions .github/actions/update-app-version/index.js
Original file line number Diff line number Diff line change
@@ -1,78 +1,77 @@
const yaml = require("js-yaml");
const core = require("@actions/core");
const exec = require("@actions/exec");
const github = require("@actions/github");
const semver = require("semver");
const fs = require("fs");
const path = require("path");
const yaml = require('js-yaml')
const core = require('@actions/core')
const exec = require('@actions/exec')
const semver = require('semver')
const fs = require('fs')
const path = require('path')

const chartsDir = path.join(process.env.GITHUB_WORKSPACE, "charts");
const appVersion = core.getInput("app_version", { required: true });
core.info(`The appVersion ${appVersion}`);
const chartsDir = path.join(process.env.GITHUB_WORKSPACE, 'charts')
const appVersion = core.getInput('app_version', { required: true })
core.info(`The appVersion ${appVersion}`)

function getCharts() {
const files = fs.readdirSync(chartsDir);
function getCharts () {
const files = fs.readdirSync(chartsDir)
const directories = files.filter((file) => {
const filePath = path.join(chartsDir, file);
return fs.statSync(filePath).isDirectory();
});
core.debug(`Charts: ${directories}`);
return directories;
const filePath = path.join(chartsDir, file)
return fs.statSync(filePath).isDirectory()
})
core.debug(`Charts: ${directories}`)
return directories
}

function updateCharts(chart) {
const chartPath = path.join(chartsDir, chart, "Chart.yaml");
const chartData = yaml.load(fs.readFileSync(chartPath, "utf8"));
function updateCharts (chart) {
const chartPath = path.join(chartsDir, chart, 'Chart.yaml')
const chartData = yaml.load(fs.readFileSync(chartPath, 'utf8'))

chartData.appVersion = appVersion;
chartData.version = semver.inc(chartData.version, "patch");
const updatedYaml = yaml.dump(chartData, { lineWidth: -1 });
fs.writeFileSync(chartPath, updatedYaml, "utf8");
core.info(`The new version of ${chart} is ${chartData.version}`);
return chartData.version;
chartData.appVersion = appVersion
chartData.version = semver.inc(chartData.version, 'patch')
const updatedYaml = yaml.dump(chartData, { lineWidth: -1 })
fs.writeFileSync(chartPath, updatedYaml, 'utf8')
core.info(`The new version of ${chart} is ${chartData.version}`)
return chartData.version
}

function updateCHANGELOG(chart, chartNewVersion) {
const changelogPath = path.join(chartsDir, chart, "CHANGELOG.md");
function updateCHANGELOG (chart, chartNewVersion) {
const changelogPath = path.join(chartsDir, chart, 'CHANGELOG.md')
const newSection = `
## [v${chartNewVersion}]

### Updated

- Bumping chart version to v${chartNewVersion} for scalr-agent v${appVersion}
`;
`
const updatedChangelog = fs
.readFileSync(changelogPath, "utf8")
.replace("## [UNRELEASED]\n", `## [UNRELEASED]\n${newSection}`);
fs.writeFileSync(changelogPath, updatedChangelog, "utf8");
.readFileSync(changelogPath, 'utf8')
.replace('## [UNRELEASED]\n', `## [UNRELEASED]\n${newSection}`)
fs.writeFileSync(changelogPath, updatedChangelog, 'utf8')
}

async function pushChanges() {
await exec.exec("git fetch");
await exec.exec("git checkout master");
await exec.exec('git config user.name "github-actions[bot]"');
await exec.exec('git config user.email "github-actions[bot]@users.noreply.github.com"');
await exec.exec("git add charts");
await exec.exec(`git commit -m "Sync appVersion: ${appVersion}`);
await exec.exec("git push -u origin master");
async function pushChanges () {
await exec.exec('git fetch')
await exec.exec('git checkout master')
await exec.exec('git config user.name "github-actions[bot]"')
await exec.exec('git config user.email "github-actions[bot]@users.noreply.github.com"')
await exec.exec('git add charts')
await exec.exec(`git commit -m "Sync appVersion: ${appVersion}`)
await exec.exec('git push -u origin master')
}

async function helmDocs() {
await exec.exec("helm-docs");
async function helmDocs () {
await exec.exec('helm-docs')
}

async function run() {
async function run () {
try {
const charts = getCharts();
const charts = getCharts()
charts.forEach(function (chart) {
const chartNewVersion = updateCharts(chart);
updateCHANGELOG(chart, chartNewVersion);
});
await helmDocs();
await pushChanges();
const chartNewVersion = updateCharts(chart)
updateCHANGELOG(chart, chartNewVersion)
})
await helmDocs()
await pushChanges()
} catch (err) {
return core.setFailed(`Error: ${err}`);
return core.setFailed(`Error: ${err}`)
}
}

run();
run()
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ repos:
args: [--allow-multiple-documents]
exclude: "^(charts/agent-k8s/templates|charts/agent-docker/templates|charts/agent-local/templates|charts/agent-job/templates)"
- id: check-added-large-files
- repo: https://github.com/lycheeverse/lychee.git
rev: lychee-v0.23.0
hooks:
- id: lychee
args: ["--no-progress", ".", "--offline", "--include-fragments", "--extensions", "md"]
pass_filenames: false
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ You can then run `helm search repo scalr-agent-helm` to see the charts.
This repository contains multiple charts for different deployment types and use cases.

- [agent-local](./charts/agent-local) – Deploys a static number of agents and executes runs in shared agent pods. **This is the recommended default option for Run agent pools** and only option for VCS agent pool.
- [agent-k8s](./charts/agent-k8s) – Deploys an agent controller with a set of agent workers and executes runs in isolated pods. Suitable for environments with strict multi-tenancy requirements. Requires more complex configuration and a separate node pool.
- [agent-job](./charts/agent-job) – Deploys an agent controller and executes runs in isolated stateless jobs. Suitable for environments with strict multi-tenancy requirements.
- [agent-k8s](./charts/agent-k8s) – Deploys an agent controller with a set of statefull agent workers and executes runs in isolated pods. Suitable for environments with strict multi-tenancy requirements. Requires more complex configuration and a separate node pool.

## Development

Expand Down
6 changes: 3 additions & 3 deletions charts/agent-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ where runs are executed in [dind](https://hub.docker.com/_/docker) sidecar conta
Run phases are isolated into docker containers.

> [!WARNING]
> This chart is planned for deprecation. Use [`agent-local`](/charts/agent-local) instead.
> This chart will be deprecated and will stop receiving updates after March 31, 2026. Please consider to use [`agent-local`](../agent-local) instead.

## Overview

This chart uses the Scalr Agent with the `docker` driver and a Docker-in-Docker sidecar container.
Originally built to run the Docker-based Agent on Kubernetes due to the lack of native Kubernetes support.
It has been retained due to adoption challenges with the native agent-k8s chart, we recommend using the newer
[agent-local](../charts/agent-local) chart for new installations instead of agent-docker.
[agent-local](../agent-local) chart for new installations instead of agent-docker.

This Kubernetes deployment does not scale across multiple replicas. As a result, the compute capacity
managed by each agent is limited to a single node. You can run multiple separate Deployments within
Expand Down Expand Up @@ -79,4 +79,4 @@ the same Kubernetes cluster to increase overall capacity.
| tolerations | list | `[]` | Tolerations for the Scalr Agent pods, allowing them to run on tainted nodes |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
4 changes: 2 additions & 2 deletions charts/agent-docker/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
{{ template "chart.description" . }}

> [!WARNING]
> This chart is planned for deprecation. Use [`agent-local`](/charts/agent-local) instead.
> This chart will be deprecated and will stop receiving updates after March 31, 2026. Please consider to use [`agent-local`](../agent-local) instead.

## Overview

This chart uses the Scalr Agent with the `docker` driver and a Docker-in-Docker sidecar container.
Originally built to run the Docker-based Agent on Kubernetes due to the lack of native Kubernetes support.
It has been retained due to adoption challenges with the native agent-k8s chart, we recommend using the newer
[agent-local](../charts/agent-local) chart for new installations instead of agent-docker.
[agent-local](../agent-local) chart for new installations instead of agent-docker.

This Kubernetes deployment does not scale across multiple replicas. As a result, the compute capacity
managed by each agent is limited to a single node. You can run multiple separate Deployments within
Expand Down
Loading
Loading