Skip to content

Commit a3c7ef7

Browse files
committed
Remove set-cbci-location, add doctoc
1 parent c59adab commit a3c7ef7

File tree

6 files changed

+50
-25
lines changed

6 files changed

+50
-25
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
fail_fast: false
44
repos:
5+
- repo: https://github.com/thlorenz/doctoc
6+
rev: v2.2.0
7+
hooks:
8+
- id: doctoc
9+
args:
10+
- -u
11+
512
- repo: https://github.com/tcort/markdown-link-check
613
rev: v3.13.7
714
hooks:

CONTRIBUTING.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,42 @@
11
# Contribute
22

3+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
4+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
5+
6+
- [Design principles](#design-principles)
7+
- [Changing the default repo and branch](#changing-the-default-repo-and-branch)
8+
- [Release process](#release-process)
9+
- [Report bugs and feature requests](#report-bugs-and-feature-requests)
10+
- [Contribute via pull requests](#contribute-via-pull-requests)
11+
- [Pre-commits: Linting, formatting and secrets scanning](#pre-commits-linting-formatting-and-secrets-scanning)
12+
- [Blueprint Terraform CI pipeline](#blueprint-terraform-ci-pipeline)
13+
- [Prerequisites](#prerequisites)
14+
- [Release](#release)
15+
16+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
17+
318
This document provides guidelines for contributing to the CloudBees CI add-on for Amazon EKS blueprints.
419

520
## Design principles
621

722
- It follows the same approach as the [Terraform AWS EKS Blueprints for Terraform Patterns](https://aws-ia.github.io/terraform-aws-eks-blueprints/).
8-
- The blueprints use a monorepo configuration to ensure that all the components are versioned together. In a production environment, it would be expected to have a single repository for the blueprints, and another repositories for the CloudBees CI configuration as code (CasC) bundles and shared libraries (see [At scale blueprint](blueprints/02-at-scale)). This approach is managed using [Spare Checkouts](https://github.blog/open-source/git/bring-your-monorepo-down-to-size-with-sparse-checkout/).
9-
- The make target `CBCI_REPO=https://github.com/example-org/example-repo.git CBCI_BRANCH=new-feat make set-cbci-location` makes possible to switch between branches when you are making updates to the CasC bundles or shared libraries.
23+
- The blueprints use a monorepo configuration to ensure that all the components are versioned together.
24+
- In a production environment, it would be expected to have a single repository for the blueprints, and another repositories for the CloudBees CI configuration as code (CasC) bundles and shared libraries (see [At scale blueprint](blueprints/02-at-scale)).
25+
- This monorepo approach is managed using [Spare Checkouts](https://github.blog/open-source/git/bring-your-monorepo-down-to-size-with-sparse-checkout/).
26+
27+
### Changing the default repo and branch
28+
29+
The following variables found in the [./variables.tf](./variables.tf) make it possible to switch between branches when you are making updates to the CasC bundles or shared libraries.
30+
31+
```sh
32+
# Optional variables in order to use a different repository and/or branch for CasC and configuration
33+
# oc_casc_scm_repo_url = "https://github.com/cloudbees-oss/terraform-aws-cloudbees-ci-eks-addon.git"
34+
# oc_casc_scm_branch = "develop"
35+
# oc_casc_scm_bundle_path = "blueprints/02-at-scale/cbci/casc/oc"
36+
# oc_casc_scm_polling_interval = "PT2M"
37+
# cbci_casc_path_controller = "blueprints/02-at-scale/cbci/casc/mc"
38+
# cbci_casc_path_shared_library = "blueprints/02-at-scale/cbci/shared-lib"
39+
```
1040

1141
## Release process
1242

@@ -64,7 +94,7 @@ To submit a pull request:
6494
7. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
6595

6696
> [!IMPORTANT]
67-
> If you make updates to embedded repository (for example, CasC bundles), you must push the changes to the public upstream (repository/branch) before running `terraform apply` locally. The endpoint and/or branch can be updated via `set-casc-location` from the companion [Makefile](blueprints/Makefile).
97+
> If you make updates to embedded repository (for example, CasC bundles), you must push the changes to the public upstream (repository/branch) before running `terraform apply` locally. The endpoint and/or branch can be updated via the terraform variables mentioned in [Changing the default repo and branch](#changing-the-default-repo-and-branch).
6898
6999
### Pre-commits: Linting, formatting and secrets scanning
70100

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The two main components of CloudBees CI - the operations center and managed cont
7575
- Amazon EBS volumes are scoped to a particular availability zone to offer high-speed, low-latency access to the Amazon Elastic Compute Cloud (Amazon EC2) instances they are connected to. If an availability zone fails, an Amazon EBS volume becomes inaccessible due to file corruption, or there is a service outage, the data on these volumes becomes inaccessible. The operations center and managed controller pods require this persistent data and have no mechanism to replicate the data, so CloudBees recommends frequent backups for Amazon EBS.
7676
- Amazon EFS file systems are scoped to an AWS region and can be accessed from any availability zone in the region that the file system was created in. Using Amazon EFS as a storage class for the operations center and managed controllers allows pods to be rescheduled successfully onto healthy nodes in the event of an availability zone outage. Amazon EFS is more expensive than Amazon EBS, but provides greater fault tolerance.
7777

78-
> [!IMPORTANT]
78+
> [!IMPORTANT]
7979
> CloudBees CI High Availability (HA) (active-active) requires Amazon EFS. For more information, refer to [CloudBees CI EKS storage requirements](https://docs.cloudbees.com/docs/cloudbees-ci/latest/eks-install-guide/eks-pre-install-requirements-helm#_storage_requirements).
8080
8181
> [!NOTE]

blueprints/02-at-scale/.auto.tfvars.example

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ dh_reg_secret_auth = { # Required.
1919
# "cb-purpose" : "demo-env"
2020
# }
2121

22+
# Optional variables in order to use a different repository and/or branch for CasC and configuration
23+
# oc_casc_scm_repo_url = "https://github.com/cloudbees-oss/terraform-aws-cloudbees-ci-eks-addon.git"
24+
# oc_casc_scm_branch = "develop"
25+
# oc_casc_scm_bundle_path = "blueprints/02-at-scale/cbci/casc/oc"
26+
# oc_casc_scm_polling_interval = "PT2M"
27+
# cbci_casc_path_controller = "blueprints/02-at-scale/cbci/casc/mc"
28+
# cbci_casc_path_shared_library = "blueprints/02-at-scale/cbci/shared-lib"
29+
30+
2231
# suffix = my-demo #Optional
2332

2433
# aws_region = "us-west-2" #Optional

blueprints/Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ set-kube-env: agentCheck
7878
@$(call helpers,set-kube-env)
7979
@$(call helpers,INFO "Setting Kube environment finished succesfully.")
8080

81-
.PHONY: set-cbci-location
82-
set-cbci-location: ## Update cbci folder location per parameter. Example: CBCI_REPO=https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon.git CBCI_BRANCH=new-feat make set-cbci-location
83-
set-cbci-location: agentCheck guard-CBCI_REPO guard-CBCI_BRANCH
84-
@$(call helpers,set-cbci-location $(CBCI_REPO) $(CBCI_BRANCH))
85-
@$(call helpers,INFO "Setting new Casc location to $(CBCI_REPO) $(CBCI_BRANCH) finished succesfully.")
86-
8781
.PHONY: zip-all-casc-bundles
8882
zip-all-casc-bundles: ## Creates a zip file containing all cbci casc bundles from 02 At scale. Example: make zip-all-casc-bundles
8983
zip-all-casc-bundles: agentCheck

blueprints/helpers.sh

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -276,21 +276,6 @@ set-kube-env () {
276276
done
277277
}
278278

279-
set-cbci-location () {
280-
local repo="$1"
281-
local branch="$2"
282-
#Repo
283-
sed -i "s|scmRepo: .*|scmRepo: \"$repo\"|g" "$SCRIPTDIR/02-at-scale/k8s/cbci-values.yml"
284-
sed -i "s|scmCascMmStore: .*|scmCascMmStore: \"$repo\"|g" "$SCRIPTDIR/02-at-scale/cbci/casc/oc/variables.yaml"
285-
sed -i "s|sharedLibRepo: .*|sharedLibRepo: \"$repo\"|g" "$SCRIPTDIR/02-at-scale/cbci/casc/mc/mc-ha/variables.yaml"
286-
sed -i "s|sharedLibRepo: .*|sharedLibRepo: \"$repo\"|g" "$SCRIPTDIR/02-at-scale/cbci/casc/mc/mc-none-ha/variables.yaml"
287-
#Branch
288-
sed -i "s|scmBranch: .*|scmBranch: $branch|g" "$SCRIPTDIR/02-at-scale/k8s/cbci-values.yml"
289-
sed -i "s|cascBranch: .*|cascBranch: $branch|g" "$SCRIPTDIR/02-at-scale/cbci/casc/oc/variables.yaml"
290-
sed -i "s|sharedLibBranch: .*|sharedLibBranch: $branch|g" "$SCRIPTDIR/02-at-scale/cbci/casc/mc/mc-ha/variables.yaml"
291-
sed -i "s|sharedLibBranch: .*|sharedLibBranch: $branch|g" "$SCRIPTDIR/02-at-scale/cbci/casc/mc/mc-none-ha/variables.yaml"
292-
}
293-
294279
zip-all-casc-bundles () {
295280
branch=$(git rev-parse --abbrev-ref HEAD)
296281
cbciDirInput="$SCRIPTDIR/02-at-scale/cbci"

0 commit comments

Comments
 (0)