diff --git a/content/en/docs/01/getting_started.md b/content/en/docs/01/getting_started.md index 6a2e665..6ce512d 100644 --- a/content/en/docs/01/getting_started.md +++ b/content/en/docs/01/getting_started.md @@ -46,6 +46,7 @@ You can also use the main navigation. `Menu` --> `Projects` --> `Create new proj * **Git repository URL**: https://github.com/appuio/example-spring-boot-helloworld.git * **Username & Password**: Leave empty +* **Project name**: Choose a unique name, e.g. prefix with your username * **Project URL**: * **Visibility Level**: Private diff --git a/content/en/docs/02/pipeline_structure.md b/content/en/docs/02/pipeline_structure.md index 004eac6..a088e44 100644 --- a/content/en/docs/02/pipeline_structure.md +++ b/content/en/docs/02/pipeline_structure.md @@ -58,7 +58,7 @@ Commit and push the changes. ```bash git add . git commit -m "Add minimal pipeline" -git push origin master +git push origin main ``` {{% /details %}} @@ -89,7 +89,7 @@ Jobs are ... ## Task {{% param sectionnumber %}}.3: Check pipeline execution -Go to your GitLab project and check the pipelines under `CI/CD` --> `Pipelines`. +Go to your GitLab project and check the pipelines under `Build` --> `Pipelines`. The pipeline at the top of the table is the one that has been triggered by your latest commit. diff --git a/content/en/docs/04/tooling_images.md b/content/en/docs/04/tooling_images.md index 1e5edfe..528be23 100644 --- a/content/en/docs/04/tooling_images.md +++ b/content/en/docs/04/tooling_images.md @@ -38,13 +38,13 @@ Using freely available Container Images is risky. Be aware of the security const ## Task {{% param sectionnumber %}}.2: Build the application -The example source is a Java 11 application. For that we use the [openjdk-11](https://catalog.redhat.com/software/containers/ubi8/openjdk-11/5dd6a4b45a13461646f677f4) Image from Red Hat. +The example source is a Java 17 application. For that we use the [openjdk-17](https://catalog.redhat.com/software/containers/ubi9/openjdk-17/61ee7c26ed74b2ffb22b07f6) Image from Red Hat. Create a new job inside `.gitlab-ci.yml` with the following configuration: * job name: `build_application` * stage: `build` -* image: `registry.access.redhat.com/ubi8/openjdk-11:latest` +* image: `registry.access.redhat.com/ubi9/openjdk-17:latest` * script:`./gradlew assemble` Don't forget to add the `build` stage to the stages list. @@ -70,9 +70,9 @@ The pipeline should now look like this: After committing the changes a new pipeline starts using the updated configuration. -Go to your GitLab project and check the pipelines under `CI/CD` --> `Pipelines`. +Go to your GitLab project and check the pipelines under `Build` --> `Pipelines`. -The Java 11 application is built using the [Gradle Build Tool](https://gradle.org/) +The Java application is built using the [Gradle Build Tool](https://gradle.org/) Check the Gradle build log and verify whether the build succeeded or not. @@ -81,7 +81,7 @@ Starting a Gradle Daemon (subsequent builds will be faster) > Task :compileJava > Task :processResources > Task :classes -> Task :bootJarMainClassName +> Task :resolveMainClassName > Task :bootJar > Task :jar > Task :assemble diff --git a/content/en/docs/05/variables.md b/content/en/docs/05/variables.md index ff25914..b5bfece 100644 --- a/content/en/docs/05/variables.md +++ b/content/en/docs/05/variables.md @@ -4,9 +4,8 @@ weight: 5 sectionnumber: 5 --- -In GitLab CI/CD, variables can be used to customize jobs by defining and storing values. When using variables there is no need to hard code values. In GitLab, CI/CD variables can be defined by going to `Settings` --> `CI/CD` --> `Variables` or by simply defining them in the .gitlab-ci.yml file. - -![GitLab Variables](../variable.png) +In GitLab CI/CD, variables can be used to customize jobs by defining and storing values. When using variables there is no need to hard code values. +In GitLab, CI/CD variables can be defined by going to `Settings` --> `CI/CD` --> `Variables` or by simply defining them in the .gitlab-ci.yml file. Variables are useful for configuring third-party services for different environments, such as testing, staging, production, etc. Modify the services attached to those environments by simply changing the variable that points to the API endpoint the services need to use. Also use variables to configure jobs and then make them available as environment variables within the jobs when they run. @@ -14,6 +13,8 @@ As pointed out before, you can define variables in your `gitlab-ci.yml`. You can If you want to reuse a variable across different Projects or Groups, you can define them through your GitLab instance (`Settings` --> `CI/CD` --> `Variables`) +![GitLab Variables](../variable.png) + In this lab we will talk about the variables in the `gitlab-ci.yml` file only. {{% alert color="primary" %}} diff --git a/content/en/docs/06/testing.md b/content/en/docs/06/testing.md index 0bc0a75..37034d7 100644 --- a/content/en/docs/06/testing.md +++ b/content/en/docs/06/testing.md @@ -15,7 +15,7 @@ Create a new job inside `.gitlab-ci.yml` with the following configuration: * job name: `test_application` * stage: `test` -* image: `registry.access.redhat.com/ubi8/openjdk-11:latest` +* image: `registry.access.redhat.com/ubi9/openjdk-17:latest` * script:`./gradlew check` {{% details title="test job solution" mode-switcher="normalexpertmode" %}} @@ -48,7 +48,7 @@ stages: ## Task {{% param sectionnumber %}}.2: Check the pipeline -Go to your GitLab project and check the pipelines under `CI/CD` --> `Pipelines`. +Go to your GitLab project and check the pipelines under `Build` --> `Pipelines`. Check that the test job was successful. diff --git a/content/en/docs/07/build_image.md b/content/en/docs/07/build_image.md index 7bfbd62..bca629e 100644 --- a/content/en/docs/07/build_image.md +++ b/content/en/docs/07/build_image.md @@ -76,7 +76,7 @@ As mentioned in the variables Lab sensitive data, for example `DOCKER_USERNAME` ## Task {{% param sectionnumber %}}.2: Check the pipeline -Go to your GitLab project and check the pipelines under `CI/CD` --> `Pipelines`. +Go to your GitLab project and check the pipelines under `Build` --> `Pipelines`. Check that the image build job was successful. diff --git a/content/en/docs/09/job_control.md b/content/en/docs/09/job_control.md index 5b52b21..4c4f0b2 100644 --- a/content/en/docs/09/job_control.md +++ b/content/en/docs/09/job_control.md @@ -29,6 +29,9 @@ Use `except` to define when a job does not run. Use the `only:refs` and `except:refs` keywords to control when to add jobs to a pipeline based on branch names or pipeline types. +{{% alert title="Warning" color="secondary" %}}`only` and `except` are not being actively developed. To control when to add jobs to pipelines, use rules instead. +{{% /alert %}} + ## {{% param sectionnumber %}}.2: Execution control @@ -54,7 +57,7 @@ Use `allow_failure` when you want to let a job fail without impacting the rest o * Add a new Job execution rule, the job should run only on the `release` branch * Add a script block with a simple `echo` command -Commit and push these changes to the main branch and go to `CI/CD` --> `Pipelines` and check the pipeline status. You may notice that the job `deploy_to_prod` is not visible. This is because we add an execution rule for the `release` branch only. To fix this, we need to switch back to `Repository` --> `Branches` and create a new branch called `release`. +Commit and push these changes to the main branch and go to `Build` --> `Pipelines` and check the pipeline status. You may notice that the job `deploy_to_prod` is not visible. This is because we add an execution rule for the `release` branch only. To fix this, we need to switch back to `Repository` --> `Branches` and create a new branch called `release`. Now the pipeline should run again and we can see the newly created job. After the pipeline executed successfully, you may notice that the `deploy` step wasn't executed yet and isn't marked with a green tick. This is because we configured the job as a manual action. To trigger this job, we need to select the job and do it manually. diff --git a/content/en/docs/11/security.md b/content/en/docs/11/security.md index 011b242..6052dde 100644 --- a/content/en/docs/11/security.md +++ b/content/en/docs/11/security.md @@ -81,7 +81,7 @@ Now the pipeline should fail because the GitLab Secret Analyzer will find a priv ![security_pipeline_fail](../security_pipeline_fail.png) -Here you see the failed pipeline. By clicking ⋮ on the right side you can download the job artifacts. To get the report of the failed job, click on `Download secret_detection_default_branch:secret_detection artifact`. We will learn more on artifacts in the next lab. +Here you see the failed pipeline. By clicking the download menu ⍗ on the right side you can download the job artifacts. To get the report of the failed job, click on `Download artifacts` and `secret_detection_default_branch:secret_detection`. We will learn more on artifacts in the next lab. {{% alert title="Warning" color="secondary" %}}If you ever push a secret into a repository, **YOU MUST CONSIDER THIS SECRET AS INSECURE**. Remove the secret from the repository and change all related secrets!{{% /alert %}} diff --git a/content/en/docs/11/security_pipeline_fail.png b/content/en/docs/11/security_pipeline_fail.png index 44ee92f..265d462 100644 Binary files a/content/en/docs/11/security_pipeline_fail.png and b/content/en/docs/11/security_pipeline_fail.png differ diff --git a/content/en/docs/12/artifacts.md b/content/en/docs/12/artifacts.md index d28959d..25c8eec 100644 --- a/content/en/docs/12/artifacts.md +++ b/content/en/docs/12/artifacts.md @@ -64,7 +64,7 @@ Click on `Download` to get the Trivy report file and open it to see the report. ## Task {{% param sectionnumber %}}.3: Pipeline Artifacts Lab -Go to your pipeline `CI/CD` --> `Pipeline` and click on the ⋮ to see the downloadable artifacts. +Go to your pipeline `Build` --> `Pipelines` and click on the download menu ⍗ to see the downloadable artifacts. Then download them and open the JUnit test report. diff --git a/manifests/04.0/.gitlab-ci.yml b/manifests/04.0/.gitlab-ci.yml index 04ebdb2..bcd531c 100644 --- a/manifests/04.0/.gitlab-ci.yml +++ b/manifests/04.0/.gitlab-ci.yml @@ -12,6 +12,6 @@ build_application: tags: - build - mobiliar - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew assemble diff --git a/manifests/05.0/05.3/.gitlab-ci.yml b/manifests/05.0/05.3/.gitlab-ci.yml index 5cd28f3..9bed0fe 100644 --- a/manifests/05.0/05.3/.gitlab-ci.yml +++ b/manifests/05.0/05.3/.gitlab-ci.yml @@ -16,6 +16,6 @@ build_application: tags: - build - mobiliar - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew assemble diff --git a/manifests/05.0/05.5/.gitlab-ci.yml b/manifests/05.0/05.5/.gitlab-ci.yml index 89d50fa..82ae668 100644 --- a/manifests/05.0/05.5/.gitlab-ci.yml +++ b/manifests/05.0/05.5/.gitlab-ci.yml @@ -17,6 +17,6 @@ build_application: tags: - build - mobiliar - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew assemble diff --git a/manifests/06.0/.gitlab-ci.yml b/manifests/06.0/.gitlab-ci.yml index bf521ad..ae48e6a 100644 --- a/manifests/06.0/.gitlab-ci.yml +++ b/manifests/06.0/.gitlab-ci.yml @@ -18,13 +18,13 @@ build_application: tags: - build - mobiliar - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew assemble test_application: stage: test - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew check artifacts: diff --git a/manifests/06.0/test-job-base.yml b/manifests/06.0/test-job-base.yml index 79e6e1a..270d5f9 100644 --- a/manifests/06.0/test-job-base.yml +++ b/manifests/06.0/test-job-base.yml @@ -1,5 +1,5 @@ test_application: stage: test - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew check diff --git a/manifests/07.0/.gitlab-ci.yml b/manifests/07.0/.gitlab-ci.yml index 9b56925..0162340 100644 --- a/manifests/07.0/.gitlab-ci.yml +++ b/manifests/07.0/.gitlab-ci.yml @@ -22,13 +22,13 @@ build_application: tags: - build - mobiliar - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew assemble test_application: stage: test - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew check artifacts: diff --git a/manifests/08.0/.gitlab-ci.yml b/manifests/08.0/.gitlab-ci.yml index aa098ca..52b36f5 100644 --- a/manifests/08.0/.gitlab-ci.yml +++ b/manifests/08.0/.gitlab-ci.yml @@ -26,13 +26,13 @@ build_application: tags: - build - mobiliar - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew assemble test_application: stage: test - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew check artifacts: diff --git a/manifests/09.0/09.4/.gitlab-ci.yml b/manifests/09.0/09.4/.gitlab-ci.yml index 2cd4d9d..9c59077 100644 --- a/manifests/09.0/09.4/.gitlab-ci.yml +++ b/manifests/09.0/09.4/.gitlab-ci.yml @@ -27,13 +27,13 @@ build_application: tags: - build - mobiliar - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew assemble test_application: stage: test - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew check artifacts: diff --git a/manifests/09.0/09.6/.gitlab-ci.yml b/manifests/09.0/09.6/.gitlab-ci.yml index 1f21685..ed59952 100644 --- a/manifests/09.0/09.6/.gitlab-ci.yml +++ b/manifests/09.0/09.6/.gitlab-ci.yml @@ -27,13 +27,13 @@ build_application: tags: - build - mobiliar - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew assemble test_application: stage: test - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew check artifacts: diff --git a/manifests/10.0/.gitlab-ci.yml b/manifests/10.0/.gitlab-ci.yml index 6d33b6f..6261b60 100644 --- a/manifests/10.0/.gitlab-ci.yml +++ b/manifests/10.0/.gitlab-ci.yml @@ -31,13 +31,13 @@ build_application: tags: - build - mobiliar - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew assemble test_application: stage: test - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew check artifacts: diff --git a/manifests/11.0/11.1/.gitlab-ci.yml b/manifests/11.0/11.1/.gitlab-ci.yml index 64968b6..aa1262c 100644 --- a/manifests/11.0/11.1/.gitlab-ci.yml +++ b/manifests/11.0/11.1/.gitlab-ci.yml @@ -35,13 +35,13 @@ build_application: tags: - build - mobiliar - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew assemble test_application: stage: test - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew check artifacts: diff --git a/manifests/11.0/11.4/.gitlab-ci.yml b/manifests/11.0/11.4/.gitlab-ci.yml index bcfdf7e..b0b7f1d 100644 --- a/manifests/11.0/11.4/.gitlab-ci.yml +++ b/manifests/11.0/11.4/.gitlab-ci.yml @@ -35,13 +35,13 @@ build_application: tags: - build - mobiliar - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew assemble test_application: stage: test - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew check artifacts: diff --git a/manifests/12.0/.gitlab-ci.yml b/manifests/12.0/.gitlab-ci.yml index fbe9469..655bf79 100644 --- a/manifests/12.0/.gitlab-ci.yml +++ b/manifests/12.0/.gitlab-ci.yml @@ -35,13 +35,13 @@ build_application: tags: - build - mobiliar - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew assemble test_application: stage: test - image: registry.access.redhat.com/ubi8/openjdk-11:latest + image: registry.access.redhat.com/ubi9/openjdk-17:latest script: - ./gradlew check artifacts: