Skip to content

Commit

Permalink
Merge branch 'main' into cd-ro-workshop
Browse files Browse the repository at this point in the history
  • Loading branch information
zvercodebender committed Sep 18, 2023
2 parents cb2c2a9 + e92c20c commit 6d9ab42
Show file tree
Hide file tree
Showing 273 changed files with 2,262 additions and 1,188 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Deploy Hugo with GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.110.0'
- name: Run build script
run: |
cd labs
chmod +x ./build.sh
./build.sh
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./labs/public

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

8 changes: 4 additions & 4 deletions docs/cloudbees-ci/cbci-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ layout: true
]

.footer[
- © 2021 CloudBees, Inc.
- © 2022 CloudBees, Inc.
- ![:scale 100%](../img/CloudBees-Submark-Full-Color.svg)
]
---
Expand Down Expand Up @@ -170,10 +170,10 @@ Different Kubernetes clouds can be configured and shared from OC or at the indiv
name: core-overview-scale

# Manage Jenkins at Scale
* Curated and verified Jenkins plug-ins with **CloudBees Assurance Program** ensures you are using the most up-to-date and secure versions via monthly security and functionality releases
* Curated and verified Jenkins plug-ins with the **CloudBees Assurance Program (CAP)** ensures you are using the most up-to-date and secure plugin-in versions via monthly security and functionality releases
* Configuration as Code for Jenkins and CloudBees CI commercial components; including plugin management and job configuration
* Enables Comprehensive Jenkins Team Management including:
* Easily provide *managed controllers* (Jenkins instance) per team
* Easily provision *managed controllers* (Jenkins instance) per team
* Centrally managed Role Based Access Control (RBAC)
* Centralized and per team Credentials Management
* Manage inbound events across multiple *managed controllers*
* Managing inbound events across multiple *managed controllers*
6 changes: 3 additions & 3 deletions docs/cloudbees-ci/cbci-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ The pre-workshop setup consisted of:
* Creating a GitHub Organization to use for this workshop.
* Installing the [CloudBees CI Workshop GitHub App](https://github.com/apps/cloudbees-ci-workshop) into your workshop GitHub Organization triggering a CloudBees CI job that:
* Installed several repositories into your workshop GitHub Organization.
* Create a CloudBees CI (Jenkins) account for you.
* Created a CloudBees CI (Jenkins) account for you.
* Provisioned a (attendee specific) CloudBees CI managed Jenkins instance we refer to as a [***managed controller***](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-admin-guide/managing-masters).

---
name: core-setup-lab
# Lab - CloudBees CI Setup
In this lab you will login into your CloudBees CI managed controller.
In this lab you will login into your CloudBees CI managed controller (enterprise Jenkins instance).

* If the URL for the CloudBees CI Workshop cluster was not already provided to you, then it will be provided by your instructor.
* The *CloudBees CI Workshop Setup* lab instructions are available at:
Expand All @@ -64,5 +64,5 @@ Let's explore the results of the workshop setup:
2. **pipeline-library** - a Jenkins Pipeline Shared Library that will be used by the Jenkins Pipelines you create during this workshop.
3. **pipeline-template-catalog** - a set of templated Pipelines that you will use to create Jenkins Pipeline jobs for this workshop.
4. **simple-java-maven-app** - a simple Java project using Maven, used to highlight contextual Pipeline feedback.
* Your CloudBees CI ***managed controller*** was also setup to use CloudBees CI configuration, as code as we will explore in more detail after the next section on Pipeline Template Catalogs.
* Your CloudBees CI ***managed controller*** was also setup to use CloudBees CI configuration as code, which we will explore in more detail after the next section on Pipeline Template Catalogs.
]
2 changes: 1 addition & 1 deletion docs/cloudbees-ci/cbci-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ name: pipeline-template-catalog

# Pipeline Template Catalogs

Pipeline Template Catalogs provide version controlled parameterized templates for Multibranch and stand-alone Pipeline jobs, and help ensure that Pipeline jobs conform to organizational standards.
Pipeline Template Catalogs provide version controlled parameterized templates for Multibranch and stand-alone Pipeline jobs, helping to ensure that Pipeline jobs conform to organizational standards.

Benefits of using Pipeline Template Catalogs include:

Expand Down
37 changes: 19 additions & 18 deletions docs/cloudbees-ci/cbci-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ name: core-casc-overview

.no-bullet[
*
* Configuration as Code (CasC) for CloudBees CI simplifies the management of a CloudBees CI cluster by capturing the configuration of CloudBees CI Operations Center and ***managed controllers*** (Jenkins instances) in human-readable declarative configuration files which can then be applied in a reproducible way and managed as code.
* Configuration as Code (CasC) for CloudBees CI simplifies the management of a CloudBees CI cluster by capturing the configuration of CloudBees CI Operations Center and ***managed controllers*** (enterprise Jenkins instances) in human-readable declarative configuration files which can then be applied in a reproducible way and managed as code.
* By capturing the configuration in files, it can be treated as a revision-controlled artifact. That configuration can be versioned, tested, validated, and then applied to a *managed controller* while being centrally managed from CloudBees CI Operations Center.
* The configuration of a CloudBees CI *managed controller* is defined in a collection of YAML files referred to as a *configuration bundle*.
* CasC for CloudBees CI expands on what is offered by OSS Jenkins CasC by enabling the management of **CasC at scale** across many *managed controllers* and including the **ability to manage plugins** and **job configuration** for all of your team specific *managed controllers*.
* CasC for CloudBees CI expands on what is offered by OSS Jenkins CasC by enabling the management of **CasC at scale** across many *managed controllers* and including the **ability to manage plugins**, **role based access control** and **job configuration** for all of the *managed controllers* in a CloudBees CI cluster.
]

???
Expand All @@ -47,24 +47,25 @@ class: compact

# CloudBees CI Configuration Bundle

CasC for CloudBees CI consists of a collection of YAML files referred to as a configuration bundle (or CasC bundle) that includes six files:
CasC for CloudBees CI consists of a collection of YAML files referred to as a configuration bundle (or CasC bundle) that includes seven file types:

1. `bundle.yaml` - provides a version for the bundle and references the other files in the bundle.
1. `bundle.yaml` - provides a version for the bundle and defines the other files in the bundle.
2. `jenkins.yaml` - contains the Jenkins configuration as defined by the OSS [Jenkins CasC plugin](https://github.com/jenkinsci/configuration-as-code-plugin) and supported CloudBees plugins.
3. `plugin-catalog.yaml` *optional* - provides a list of plugins that are **ALLOWED** to be installed on your *managed controllers* that are not already included as part of the CloudBees Assurance Program (CAP) Core plugins.
4. `plugins.yaml` *optional* - contains a list of all plugins that will be **INSTALLED/UPDATED** on the configured *managed controllers* - but plugins can only be installed if included via the `plugin-catalog.yaml` or if they are already included as CloudBees CAP plugins.
5. `rbac.yaml` *optional* - contains RBAC configuration for individual managed controllers.
6. `items.yaml` *optional* - contains configuration for items to be created on managed controller.
5. `rbac.yaml` *optional* - contains root level RBAC configuration for individual managed controllers.
6. `items.yaml` *optional* - contains configuration for items (jobs, folders, etc.) to be created on managed controller.
7. `variables.yaml` *optional* - defines the variables that can be used in the `jenkins.yaml`, `items.yaml`, and `rbac.yaml` files.

---
name: enable-casc
class: compact

# Enabling CasC for a CloudBees CI Managed Controllers (Jenkins instance)
# Enabling CasC for a CloudBees CI Managed Controller

* After you installed the CloudBees CI Workshop GitHub App into your workshop GitHub Organization a customized configuration bundle was created in your copy of the **cloudbees-ci-config-bundle** repository was copied to a special sub-directory (`jcasc-bundles-store`) on CloudBees CI Operations Center with a **bundle name** configured to be available for your *managed controller*.
* When the CloudBees CI Operations Center is provisioning a *managed controller* it will check to see if it has a bundle available and configured for the specific *managed controller* being provisioned. If so it will copy a CloudBees CI configuration bundle link YAML file to `/var/casc-bundle/bundle-link.yaml` on the *managed controller* and set the value of the `core.casc.config.bundle` system property to match that file path.
* Your *managed controller* uses that protected link to download the CloudBees CI configuration bundle to your *managed controller*. The `jenkins.yaml` file was downloaded (along with other bundle yaml files) from the CloudBees CI Operations Center to the managed controller's `/var/jenkins_home/core-casc-bundle/` directory and the `casc.jenkins.config` system property was set to the `jenkins.yaml` file path.
* After you installed the CloudBees CI Workshop GitHub App into your workshop GitHub Organization, a customized configuration bundle was created in your copy of the **cloudbees-ci-config-bundle** repository. The CasC *bundle* was then copied to a special sub-directory (`jcasc-bundles-store`) on the CloudBees CI Operations Center with a **bundle name** configured to **only be available** for your *managed controller*.
* When the CloudBees CI Operations Center provisions a *managed controller*, it will check to see if it has a bundle available and configured to be available for the specific *managed controller* being provisioned. If so, it will copy a CloudBees CI configuration bundle link YAML file to the `/var/casc-bundle/bundle-link.yaml` path on the *managed controller* and set the value of the `core.casc.config.bundle` system property to match that file path.
* Your *managed controller* uses that protected link to download the CloudBees CI configuration bundle to the *managed controller*. The `jenkins.yaml` file was downloaded (along with other bundle yaml files) from the CloudBees CI Operations Center to the managed controller's `/var/jenkins_home/core-casc-bundle/` directory and the `casc.jenkins.config` system property was set to the `jenkins.yaml` file path.

---
name: config-bundle-details-yaml
Expand Down Expand Up @@ -95,12 +96,12 @@ name: config-bundle-details-credentials
# JCasC Credentials
CloudBees CI CasC was used to create two user specific Jenkins credentials for use in the rest of this workshop.
CloudBees CI CasC was used to create several Jenkins credentials for use in the rest of this workshop.
.no-bullet[
* [JCasC Secrets](https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/docs/features/secrets.adoc) for credentials can be managed in a few different ways:
1. As properties files in the Managed Jenkins file system. For secrets that you want to share across ***managed controller*** you can mount the same [Kubernetes Secret](https://kubernetes.io/docs/concepts/configuration/secret/) to every *managed controller*.
2. As Jenkins encrypted values using the Jenkins-internal secret key allowing the encrypted strings to be used directly in the `jenkins.yaml` configuration as we are doing in this workshop. The Jenkins-internal secret key used for encryption is unique to a Jenkins instance and means that the credentials are not portable between Jenkins instances.
2. As Jenkins encrypted values using the Jenkins-internal secret key. This allows the encrypted strings to be used directly in the `jenkins.yaml` configuration. The Jenkins-internal secret key used for encryption is unique to a Jenkins instance and means that the credentials are not portable between Jenkins instances.
* For the CloudBees CI Workshop we have mounted Kubernetes `Secrets` to each of your *managed controller* for use with the GitHub, Slack and cross team collaboration integrations.
]

Expand All @@ -110,10 +111,10 @@ name: config-bundle-details-additional
# Additional JCasC Configuration
#### Pipeline Shared Library
.no-bullet[
* JCasC allows auto-configuring Pipeline Shared Libraries so it is very easy to provide the same Pipeline Shared Libraries across multiple teams - as we have done for this workshop. The CloudBees CI Pipeline Shared Library was configured at the Jenkins global configuration level so that it will be available for all the Jenkins Pipeline jobs that you run on your *managed controller* for this workshop.
* JCasC allows auto-configuring Pipeline Shared Libraries so it is very easy to provide the same Pipeline Shared Libraries across multiple teams - as we have done for this workshop. The CloudBees CI Pipeline Shared Library was configured at the Jenkins global configuration level so that it will be available for **all** the Jenkins Pipeline jobs that you run on your *managed controller*.
]
#### Other Configuration
* Applied a **System Message** to your *managed controller* so you could see that the CloudBees CI CasC bundle was applied
* Applied a **System Message** to your *managed controller* so you could see that the CloudBees CI CasC bundle changes were applied.
* Created a *managed controller* level Kubernetes Pod Template for use in a later lab.
* Installed several plugins to be used in the rest of the workshop.

Expand All @@ -124,10 +125,10 @@ name: core-casc-lab-link

.no-bullet[
*
* One of the main reasons to manage configuration as code is to take advantage of features provided by source control tools - like GitHub webhooks for example. You don't want to have to execute any manual steps when you commit approved changes to your CloudBees CI configuration.
* One of the main reasons to manage configuration as code is to take advantage of features provided by source control tools - like commit history for auditing and GitHub webhooks. GitHub webhooks allow us to avoid manual steps when you commit approved changes to your CloudBees CI configuration and automatically make those updates available for your *managed controller*.
]

* In the following lab we will update a Jenkins Pipeline job - or more specifically, a **Pipeline Template** based job on your ***managed controller*** that will be triggered whenever you commit any approved changes to the **`main`** branch of your CloudBees CI configuration bundle repository.
* In the following lab we will update a Jenkins Pipeline job - or more specifically, a **Pipeline Template** based job on your *managed controller* that will be triggered whenever you commit any approved changes to the **`main`** branch of your CloudBees CI configuration bundle repository.
* The *GitOps for CloudBees CI CasC* lab instructions are available at:
* https://cloudbees-ci.labs.cb-sa.io/module-1/casc/

Expand All @@ -140,8 +141,8 @@ name: casc-lab-review

# CloudBees CI - GitOps for CloudBees CI CasC Lab Review

* You created a Pipeline job, via a GitHub Organization Folder project, that will update your ***managed controller*** configuration bundle whenever you commit any changes to the **`master`** branch of your fork of the **`cloudbees-ci-config-bundle`** repository. This is GitOps for Jenkins configuration.
* Then, via the GitHub Pull Request, you merged the CloudBees CI CasC bundle for your *managed controller*, and finally you applied an update that included several new plugins and configuration for some of those plugins.
* You created a Pipeline template catalog job that will update your ***managed controller*** configuration bundle whenever you commit any changes to the **`main`** branch of your fork of the **`cloudbees-ci-config-bundle`** repository. This is GitOps for Jenkins configuration.
* Then, via the GitHub Pull Request, you merged changes for the CloudBees CI CasC bundle for your *managed controller*, and finally you applied that update that included several new plugins and configuration for some of those plugins.
* In the next sections and labs we will be exploring the functionality of those plugins and other features - to include:
* CloudBees CI *managed controller* specific Pod Templates for Kubernetes based agents
* Pipeline Template Catalogs
Expand Down
2 changes: 1 addition & 1 deletion docs/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ layout: true
]

.footer[
- © 2021 CloudBees, Inc.
- © 2022 CloudBees, Inc.
- ![:scale 100%](img/CloudBees-Submark-Full-Color.svg)
]
---
Expand Down
18 changes: 18 additions & 0 deletions labs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
git submodule update --init --recursive

cd base || exit 1

excluded_dirs="base workshop-setup public"
directories=$(ls -d ../*/ | grep -vE "($(echo $excluded_dirs | sed 's/ /|/g'))/")

echo "<html><head><title>CloudBees Labs</title></head><body>" >../public/index.html
echo "<h1>Current Labs</h1><ul>" >>../public/index.html

for dir in $directories; do
dir_name=$(basename $dir)
hugo --minify --config "${dir}/config.toml" --contentDir "${dir}/content/" --destination "../public/${dir_name}" --baseURL="/cloudbees-field-workshops/${dir_name}/"

echo "<li><a href=\"/cloudbees-field-workshops/${dir_name}/\">${dir_name}</a></li>" >>../public/index.html
done

echo "</ul></body></html>" >>../public/index.html
26 changes: 26 additions & 0 deletions labs/cloudbees-cdro-compliance/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
baseURL = ""
languageCode = "en-US"
defaultContentLanguage = "en"

title = "CloudBees CD/RO DevOps World 2023 Workshop!"
theme = "hugo-theme-learn"
metaDataFormat = "yaml"

[outputs]
home = [ "HTML", "RSS", "JSON"]

[params]
# Change default color scheme with a variant one. Can be "red", "blue", "green".
themeVariant = "cloudbees"
editURL = "https://github.com/cloudbees-days/cloudbees-field-workshops/edit/main/labs/cloudbees-cdro-compliance/content/"
# Shows a checkmark for visited pages on the menu
showVisitedLinks = true
# Set this to true to disable copy-to-clipboard button for inline code.
disableInlineCopyToClipBoard = true
# If set to false, a Home button will appear below the search bar on the menu.
disableLandingPageButton = true

[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
9 changes: 9 additions & 0 deletions labs/cloudbees-cdro-compliance/content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: "CloudBees CD/RO DevOps World 2023 Workshop!"
chapter: true
weight: 1
---

# CloudBees CD/RO DevOps World 2023 Workshop

This workshop will familiarize you with CloudBees Software Delivery Automation and CloudBees CD/RO. Complete the hands-on labs to explore the features and technical advantages of CloudBees Platform for securing your SDLC.
21 changes: 21 additions & 0 deletions labs/cloudbees-cdro-compliance/content/labs/01_pre-reqs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: "Pre-requisites"
chapter: false
weight: 2
---

Welcome to the workshop.

---
<link rel="stylesheet" href="../styles/spinner.css" />

## Registration

<div id="content">
<div class="spin"></div>
</div>
<noscript>
<p>Javascript is required for this form to work.</p>
</noscript>

<script type="module" src="../scripts/pre-reqs.js"></script>
Loading

0 comments on commit 6d9ab42

Please sign in to comment.