This documentation is based on https://zuul-ci.org/docs/zuul/tutorials/quick-start.html and NOT purposed for production usage.
You might want to use local docker or some VM (with docker).
docker-compose is also required.
For this demo, I will stick with the GitHub app method and NOT the webhook method. You can either create one for your organization or for your account. If can be public or private, though private would make more sense. Otherwise other people could install them in their repository and might abuse them for crypto-minig, etc.
- Go to the settings of your account/organization
- Select
Developer settingson the left hand side - Select
GitHub Appson the left hand side - Select
New GitHub Appon the right hand side - Select a unique
GitHub App name, e.g. tibeerorg-zuul - Select a dummy
Homepage URL(this URL is opened when installing this app to a repository). I used https://www.google.com - Set the
Webhook URLtowherehttp://<zuul-hostname>:<port>/api/connection/<connection-name>/payload
zuul-hostnameis the IP or DNS name of your serverportis the Zuul port (typically 9000)connection-nameis the name you will later set in your zuul configuration. In this case I use githubzuulapp
- Set the
Webhook secretto a value of your choice and save it for later. I'll use wekhooksecretvalue - Select the following
Repository persmissions:Permission Access Administration Read-only Checks Read & write Contents Read & write Issues Read & write Pull requests Read & write Commit statuses Read & write - Select the events you whish to subscribe to:
- Check run
- Commit comment
- Create
- Issue comment
- Issues
- Label
- Pull request
- Pull request review
- Pull request review comment
- Push
- Release
- Status
- Select
Where can this GitHub App be installed?to Only on this account - Click on
Create GitHub App - Save also the
App IDfor later (in our case 121873) - Scroll down to
Private keysand click Generate a private key - Save the received pem file for later
- Install the GitHub app to your whished repositories / accounts / repositories by clicking on
Install Appon the left hand side.
Note: sometimes it might happen that GitHub does not save your Webhook secret. Just re-enter it and save it again.
Clone the example repository
git clone https://opendev.org/zuul/zuulReplace all content with the equivalant content below.
Note the name of the source stanza matches your connection name you put earlier in the Webhook URL.
Note that at least the config-projects GitHub respositories need to exists before
you start your Zuul services. You may use the one from this organization, but I would suggest
to clone it to your account/organization (then you will also be able to set the log server).
The opendev.org connection is highly recommended. The base jobs are based on this job collection.
By defining include you can restrict zuul to only load jobs and not something like pipelines.
~/zuul/doc/source/examples/etc_zuul/main.yaml
- tenant:
name: showcase
source:
githubzuulapp:
config-projects:
- tibeerorg/zuul_config:
load-branch: main
untrusted-projects:
- tibeerorg/zuul_demo_repo
opendev.org:
untrusted-projects:
- zuul/zuul-jobs:
include:
- jobThrow away all "connection" sections and replace all of them with these new two.
Note, that you need to insert your webhook_token and app_id values you saved
earlier. Also note that your connection name needs to match the name you put earlier
in the Webhook URL. Otherwise you won't get a connection.
~/zuul/doc/source/examples/etc_zuul/zuul.conf
[connection "githubzuulapp"]
driver=github
webhook_token=wekhooksecretvalue
app_id=121873
app_key=/etc/zuul/github.pem
[connection "opendev.org"]
name=opendev
driver=git
baseurl=https://opendev.orgThe github.pem file is not there yet. Use the pem file you saved earlier and upload
it to your Zuul instance to this file: ~/zuul/doc/source/examples/etc_zuul/github.pem
cd zuul/doc/source/examples
sudo -E docker-compose -p zuul-tutorial up -dThis might take a few minutes.
Go back to your GitHub app settings:
- Open the
Settings - Click on
Installed GitHub Appson the left hand side - Click
Configureon the right hand side - Click
App settingson the top - Click
Advancedon the left hand side - Check if the top entry has a green tick (if not, click on Redeliver)
You should now be able to access your Zuul installation by directing your browser to the IP address or DNS name of your server followed by the port (typically 9000)