diff --git a/demos/docker-plugin/README.md b/demos/docker-plugin/README.md new file mode 100644 index 0000000000..d1285516f8 --- /dev/null +++ b/demos/docker-plugin/README.md @@ -0,0 +1,20 @@ +# Docker Plugin — SSH Connector JCasC Demo + +This demo provides a working Jenkins Configuration as Code (JCasC) example for configuring +the Docker plugin with the SSH connector. The existing documentation does not show how to +set up SSH-based agents using the docker-plugin, so this example is added to fill that gap. + +## SSH connector usage + +The docker-plugin exposes the `sshConnector` field for configuring SSH-based cloud agents. +Using other keys such as `ssh:` does not match the expected structure and will cause a +configuration error. + +A working configuration can be found in `docker-plugin-ssh.yaml`. The key part of the +connector configuration is: + +```yaml +connector: + sshConnector: + sshKeyCredentialsId: "my-ssh-key-id" + javaPath: "/opt/java/openjdk/bin/java" diff --git a/demos/docker-plugin/docker-plugin.ssh.yaml b/demos/docker-plugin/docker-plugin.ssh.yaml new file mode 100644 index 0000000000..0e3ebde86d --- /dev/null +++ b/demos/docker-plugin/docker-plugin.ssh.yaml @@ -0,0 +1,20 @@ +# demos/docker-plugin/docker-plugin-ssh.yaml +jenkins: + clouds: + - docker: + name: "my-docker-cloud" + dockerHost: + uri: "unix:///var/run/docker.sock" + templates: + - labelString: "worker1-agent" + dockerTemplateBase: + image: "jenkins/ssh-agent:latest-jdk17" + mounts: + - "type=tmpfs,destination=/run" + - "type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock" + + remoteFs: "/home/jenkins/agent" + connector: + sshConnector: + sshKeyCredentialsId: "my-ssh-key-id" + javaPath: "/opt/java/openjdk/bin/java" diff --git a/demos/jobs/multibranch-github.yaml b/demos/jobs/multibranch-github.yaml index 5d14e29984..66e35cfcaa 100644 --- a/demos/jobs/multibranch-github.yaml +++ b/demos/jobs/multibranch-github.yaml @@ -21,4 +21,4 @@ jobs: interval('5') } } - } + } \ No newline at end of file diff --git a/demos/matrix-auth/README.md b/demos/matrix-auth/README.md index 9d846e0c49..1eb060bc64 100644 --- a/demos/matrix-auth/README.md +++ b/demos/matrix-auth/README.md @@ -1,5 +1,10 @@ # matrix-auth-plugin +> **Note:** Starting from **matrix-auth 3.2**, the older +> `grantedPermissions:` JCasC syntax is **deprecated**. +> The examples below already use the new **`entries:`** format, which should be used going forward. + + Configuration of the [Matrix Authorization Strategy plugin](https://plugins.jenkins.io/matrix-auth) There are a couple of built-in authorizations to consider.