diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index ecd20374..00000000 --- a/.gitpod.yml +++ /dev/null @@ -1,26 +0,0 @@ -# This .gitpod.yml file is used to configure the Gitpod workspace. - -# The 'image' field specifies the Docker image to be used for the workspace. -# The 'file' field under 'image' points to the Dockerfile that is used to build the Docker image. -image: - file: .gitpod/Dockerfile - -# The 'tasks' field specifies a list of commands that are run when the workspace is initialized. -# The 'init' field under 'tasks' specifies the command to be run before the main command. -# In this case, it downloads and installs 'yq', a command-line YAML processor, and runs several shell scripts. -tasks: - - init: sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 && sudo chmod a+x /usr/local/bin/yq && chmod +x ./dockerfiles/gitpodURL.sh && ./dockerfiles/gitpodURL.sh - -# The 'ports' field specifies a list of ports that should be exposed in the workspace. -# Each item in the list can have a 'name', 'port', 'protocol', 'onOpen', and 'description'. -# 'name' is a human-readable name for the port. -# 'port' is the port number. -# 'protocol' is the protocol used (e.g., 'http', 'https'). -# 'onOpen' specifies what should happen when the port is opened (e.g., 'open-preview', 'open-browser'). -# 'description' provides additional information about the port. -ports: - - name: Jenkins controller - port: 8080 - protocol: http - onOpen: open-preview - description: The Jenkins Controller to use for the tutorials \ No newline at end of file diff --git a/.gitpod/Dockerfile b/.gitpod/Dockerfile deleted file mode 100644 index 1aef4d68..00000000 --- a/.gitpod/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# This Dockerfile is used to create a Gitpod workspace with GitHub CLI installed. - -# We start from the Gitpod full workspace image which includes a broad range of development tools. -FROM gitpod/workspace-full:2025-10-16-17-48-52 - -# The RUN command executes a series of commands in the new layer of the image and commits the results. -# The following commands are executed: - -# 1. Check if curl is installed. If not, update the package list and install curl. -# 2. Download the GPG key for the GitHub CLI repository and save it to a specific location. -# 3. Change the permissions of the GPG key file to make it readable for all users. -# 4. Add the GitHub CLI repository to the list of APT sources. -# 5. Update the package list again to include packages from the newly added repository. -# 6. Install the GitHub CLI (gh). -# 7. Clean up the APT cache to reduce the size of the image. -# 8. Remove unnecessary files and directories to further reduce the size of the image. -RUN type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) && \ - curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \ - sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && \ - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \ - sudo apt update && \ - sudo apt install gh -y && \ - sudo apt-get clean && \ - sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/README.md b/README.md index 4ea42937..9ac3f5ac 100644 --- a/README.md +++ b/README.md @@ -18,16 +18,6 @@ This repository includes the files necessary for transitioning from `docker` to 3. Wait for the environment to initialize (~2-3 minutes) 4. Follow the welcome message in the terminal to start a tutorial -### How to Set Up the Repository in GitPod? (Legacy) - -**Note**: GitPod's free tier has sunset. We recommend using GitHub Codespaces instead. - -- Access our Gitpod workspace [here](https://gitpod.io/#https://github.com/jenkins-docs/quickstart-tutorials). - -## GitPod (Legacy) - -GitPod is a cloud-based development environment designed for teams. It supports various IDEs, including VScode, IntelliJ, and many more, enabling efficient and secure software development. - ### Steps to Run Examples from the Repository - Use `docker compose up` to run examples from this project. Currently, we have four working examples: @@ -51,7 +41,6 @@ GitPod is a cloud-based development environment designed for teams. It supports - Check the status of the container with the `docker ps` or `docker compose ps` commands. - Access your running Jenkins instance at [http://127.0.0.1:8080](http://127.0.0.1:8080). -- On Gitpod, if containers are running successfully after entering `docker compose --profile up`, a pop-up titled `A service is available on port 8080` should appear. If it doesn't, you can view the running service in the `PORTS` section on the right side of the terminal. ### Clean Up Instructions @@ -59,18 +48,6 @@ GitPod is a cloud-based development environment designed for teams. It supports - If you encounter a `Resource is still in use` warning, use the `--remove-orphans` option which would give `docker compose --profile down --remove-orphans`. - To remove the created volumes (should you need to restart from scratch), add the `-v` option which would give `docker compose --profile down -v`. -### Suppressing Jenkins Warning using JCASC - -To improve the Gitpod experience with Jenkins, we've suppressed a reverse proxy setup warning in Jenkins that was causing issues in the Gitpod environment. We achieved this using Jenkins Configuration as Code ([JCASC](https://www.jenkins.io/projects/jcasc/)) and added the following property to the JCASC YAML file: - -```yaml -jenkins: - disabledAdministrativeMonitors: - - "hudson.diagnosis.ReverseProxySetupMonitor" -``` - -For more detailed information about this configuration and the context behind it, please refer to the [corresponding issue](https://github.com/ash-sxn/GSoC-2023-docker-based-quickstart/issues/61). - ### Encountering Issues? If you encounter any issues while running the examples, please open an issue [in this repository](https://github.com/jenkins-docs/quickstart-tutorials/issues/new/choose). diff --git a/build-docker-compose.yaml b/build-docker-compose.yaml index 42f9b7c3..8cf2c22d 100644 --- a/build-docker-compose.yaml +++ b/build-docker-compose.yaml @@ -45,7 +45,6 @@ services: build: dockerfiles/. restart: on-failure # The CASC_RELOAD_TOKEN environment variable is used by the Jenkins controller to restart the Configuration as Code (JCasc) plugin configuration. - environment: - CASC_RELOAD_TOKEN=thisisnotsecure ports: - "8080:8080" @@ -118,8 +117,6 @@ services: - agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only node: build: dockerfiles/node/. - environment: - - GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL} container_name: desktop-jenkins_agent-1-node profiles: - node @@ -140,8 +137,6 @@ services: - agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only multi: build: dockerfiles/multi/. - environment: - - GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL} container_name: desktop-jenkins_agent-1-multi profiles: - multi @@ -163,8 +158,6 @@ services: - agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only android: build: dockerfiles/android/. - environment: - - GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL} container_name: desktop-jenkins_agent-1-android profiles: - android @@ -186,8 +179,6 @@ services: - agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only golang: build: dockerfiles/golang/. - environment: - - GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL} container_name: desktop-jenkins_agent-1-golang profiles: - golang diff --git a/docker-compose.yaml b/docker-compose.yaml index 5a4e6cfb..adc9f3ae 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -65,7 +65,6 @@ services: - dotnet - default # The CASC_RELOAD_TOKEN environment variable is used by the Jenkins controller to restart the Configuration as Code (JCasc) plugin configuration. - environment: - CASC_RELOAD_TOKEN=thisisnotsecure # The Jenkins web interface is exposed on port 8080. ports: @@ -178,8 +177,6 @@ services: - agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only node: image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:node_agent_${BRANCH_SUFFIX} - environment: - - GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL:-} container_name: desktop-jenkins_agent-1-node profiles: - node @@ -200,8 +197,6 @@ services: - agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only android: image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:android_agent_${BRANCH_SUFFIX} - environment: - - GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL:-} container_name: desktop-jenkins_agent-1-android profiles: - android @@ -241,8 +236,6 @@ services: retries: 5 multi: image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:node_agent_${BRANCH_SUFFIX} - environment: - - GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL:-} container_name: desktop-jenkins_agent-1-multi profiles: - multi @@ -264,8 +257,6 @@ services: - agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only golang: image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:golang_${BRANCH_SUFFIX} - environment: - - GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL:-} container_name: desktop-jenkins_agent-1-golang profiles: - golang @@ -286,8 +277,6 @@ services: - agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only cpp: image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:cpp_${BRANCH_SUFFIX} - environment: - - GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL:-} container_name: desktop-jenkins_agent-1 profiles: - cpp @@ -308,8 +297,6 @@ services: - agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only dotnet: image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:dotnet_${BRANCH_SUFFIX} - environment: - - GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL:-} container_name: desktop-jenkins_agent-1 profiles: - dotnet diff --git a/dockerfiles/gitpodURL.sh b/dockerfiles/gitpodURL.sh deleted file mode 100755 index 6513e01b..00000000 --- a/dockerfiles/gitpodURL.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -# Set the path to the configuration file -config_file="/workspace/quickstart-tutorials/dockerfiles/jenkins.yaml" - -# Extract the hostname from the GITPOD_WORKSPACE_URL variable -service_url=$(echo "$GITPOD_WORKSPACE_URL" | awk -F/ '{print $3}') - -# Define an array of targets -targets=("maven" "node" "python" "multi" "cpp" "dotnet" "default") - -# Initialize an empty string for the message -message="As a gentle reminder, the current profiles are: " - -# Loop over the targets array -for target in "${targets[@]}"; do - # Append to the message string - message+="\033[36m$target\033[0m, " -done - -# Remove the trailing comma and space -message=${message%??} - -# Print the hostname for debugging purposes -echo -e "Once you enter \033[42;30mdocker compose --profile _profile_ up\033[0m, Jenkins will be accessible here: \033[36mhttps://8080-$service_url\033[0m" -# Print the message -echo -e "$message" -# Loop over the targets array -for target in "${targets[@]}"; do - echo -e "To start the $target service, enter: \033[42;30mdocker compose --profile $target up\033[0m" -done - -# Use yq to update the value of the .unclassified.location.url field in the configuration file -yq eval ".unclassified.location.url = \"https://8080-$service_url/\"" "$config_file" > "$config_file.tmp" && mv "$config_file.tmp" "$config_file" - -# Use yq to add a line to suppress the Reverse Proxy setup is broken warning -yq e -i ".jenkins.disabledAdministrativeMonitors = [\"hudson.diagnosis.ReverseProxySetupMonitor\"]" $config_file diff --git a/updatecli/updatecli.d/devcontainer.yaml b/updatecli/updatecli.d/devcontainer.yaml index da10c150..e54f604b 100644 --- a/updatecli/updatecli.d/devcontainer.yaml +++ b/updatecli/updatecli.d/devcontainer.yaml @@ -44,7 +44,7 @@ targets: sourceid: dockerLatestMinor spec: file: .devcontainer/devcontainer.json - matchpattern: '("version": ")([0-9.]*)(",)' + matchpattern: '("version": "v?)([0-9.]*)(",)' replacepattern: '${1}{{ source "dockerLatestMinor" }}${3}' search: pattern: 'ghcr\.io/devcontainers/features/docker-in-docker' @@ -58,7 +58,7 @@ targets: sourceid: githubcliLatestMinor spec: file: .devcontainer/devcontainer.json - matchpattern: '("version": ")([0-9.]+)(")' + matchpattern: '("version": "v?)([0-9.]+)(")' replacepattern: '${1}{{ source "githubcliLatestMinor" }}${3}' search: pattern: 'ghcr\.io/devcontainers/features/github-cli' diff --git a/updatecli/updatecli.d/gitpod.yaml b/updatecli/updatecli.d/gitpod.yaml deleted file mode 100644 index 4c728c1b..00000000 --- a/updatecli/updatecli.d/gitpod.yaml +++ /dev/null @@ -1,44 +0,0 @@ ---- -name: 'deps(dockerfile): bump image "gitpod/workspace-full" digest' - -scms: - default: - kind: github - spec: - user: "{{ .github.user }}" - email: "{{ .github.email }}" - owner: "{{ .github.owner }}" - repository: "{{ .github.repository }}" - token: "{{ requiredEnv .github.token }}" - username: "{{ .github.username }}" - branch: "{{ .github.branch }}" - -sources: - gitpod/workspace-full: - name: get latest image "gitpod/workspace-full" - kind: dockerimage - spec: - image: gitpod/workspace-full - tagfilter: '\d{4}-\d{2}-\d{2}-\d{2}-\d{2}-\d{2}' - -targets: - gitpod/workspace-full: - name: 'deps(dockerfile): bump image "gitpod/workspace-full"' - scmid: default - kind: dockerfile - spec: - file: .gitpod/Dockerfile - instruction: - keyword: FROM - matcher: gitpod/workspace-full - sourceid: gitpod/workspace-full - -actions: - default: - kind: github/pullrequest - scmid: default - title: Bump Gitpod version to {{ source "gitpod/workspace-full" }} - spec: - labels: - - dependencies - - debian-bookworm \ No newline at end of file