Demo of GitHub Organization, multibranch projects, and pull requests.
To run the demo:
- Start the image:
- from sources:
- from binaries:
docker run --rm -p 8080:8080 -p 4040:4040 -v /var/run/docker.sock:/var/run/docker.sock --group-add=$(stat -c %g /var/run/docker.sock) -ti jenkinsci/pipeline-as-code-github-demo
- Visit localhost:8080.
- Prepare your environment in GitHub:
- Create an organization or user account (or use an existing one)
- Fork multibranch-demo to your own account or organization
- Log in with the random administrative password printed to the Docker log. Skip the rest of the setup wizard (close the dialog).
- Go to Credentials » GitHub and add a username/password pair using an access token generated here.
- Configure a personal access token with these scopes:
- Create a new item, selecting GitHub Organization as the type, and setting the name to your account or organization name (for example,
- Select your credentials token under Scan Credentials
- Optionally add the Filter by name (with wildcards) option, Includeing
- Save; you will see repositories being scanned.
- Go back to the organization index page. You should see
multibranch-demo, under that one or more branches including
master, and under each a successful build #1
- Add a new webhook, ask to Send me everything, and specify a URL like
https://SOMETHING.ngrok.io/github-webhook/(look at the Docker log for the specific hostname). Remember to clean up your webhook when the demo is done
- File pull requests (from a forked repository, not from origin branches) and see them being built.
The image needs to run Docker commands, so it assumes that your Docker daemon is listening to
/var/run/docker.sock (discussion). This is not “Docker-in-Docker”; the container only runs the CLI and connects back to the host to start sister containers. The
run target also makes reference to file paths on the Docker host, assuming they are where you are running that command, so this target cannot work on boot2docker. There may be some way to run this demo using boot2docker; if so, please contribute it.