Trigger gitlab build from github events
To configure GitHub to use failfast-ci, add an application through "Developer Settings", "GitHub Apps".
-
Create "New GitHub App"
-
Give the app a name.
-
Add a homepage url. I use the url for our fork of failfast-ci.
-
Set the "Webhook URL" to
http[s]://<your api server hostname>/api/v1/github_event
. -
Add permissions:
- Repository Administration: Read
- Commit statuses: Read and Write
- Deployments: Read and Write
- Issues: Read and Write
- Pull Requests: Read and Write
- Repository Contents: Read and Write
- Organization Members: Read
-
Subscribe to events:
- Label
- Repository
- Deployment
- Pull Request
- Commit comment
- Delete
- Push
- Public
- Status
- Deployment status
- Pull request review
- Pull request review comment
- Create
- Release
-
"Where can this GitHub App be installed?"
Unless you want to make this app and its connected services available to the entirety of GitHub, set this to "Only on this account".
-
Click "Create GitHub app"
-
Click "Generate Private Key". This will download a PEM file. Make a note of its filename and download location.
-
Make a note of the GitHub Application ID found under the "About" header labeled "ID".
Note: If you're going to install failfast-api via helm, you'll need to double base64 encode the PEM file downloaded above, eg.:
base64 -w0 <filename.pem> | base64 -w0 > /tmp/pemb64.b64
To configure GitLab to use failfast-ci, add a robot user, a group, and make the robot a maintainer of the group.
-
From the "Users" section of the Admin Area create a "New User".
-
Give it a "Name", "User Name", and "Email".
Note: with many email systems you can use an existing email address with the "+" notation for adding additional "sub-email" addresses, eg.
[email protected]
. -
Uncheck "Can Create Group".
-
"Create User"
-
Click on the "Impersonation Tokens" heading.
-
Add a name for the application that will use this token, eg.
failfast-ci
. This name is an arbitrary string. -
Check both "api" and "read_user".
-
Click "Create impersonation token".
-
Save the Token shown for configuration.
The project is using flake8, pylint, yapf and mypy. To automatically format and lint run the commands:
make prepare
or only lint:
make check
The .gitlab-ci.yml
is generated from the .gitlab-ci.jsonnet
To add or modify the jobs edit the .gitlab-ci.jsonnet
or the files in the .gitlab-ci
directory and generate the yaml file it requires https://github.com/failfast-ci/ffctl
pip install ffctl
make gen-ci