Platypus Checker is a complete Jenkins setup designed to automate the process of testing and validating your projects.
- A linux machine with Docker installed.
- Access to your code repository.
- A Clerk account.
The setup process is divided into three main parts: Jenkins, Clerk, and the Frontend.
-
Clone this repository to your machine:
git clone https://github.com/skignes/Platypus-Checker.git cd Platypus-Checker -
In the
docker-composefile, change the environment variable namedFRONTEND_URLto the URL of your frontend.environment: FRONTEND_URL: "http://<your-url>/" CASC_JENKINS_CONFIG: "/var/jenkins_home/casc_configs" USER_ADMIN_PASSWORD: "admin" USER_API_PASSWORD: "api" BINARY: "/opt/jenkins/binary" JSON: "/opt/jenkins/json" -
Build the Jenkins instance:
docker compose build jenkins
-
Start Jenkins:
docker compose up jenkins -d
-
Access Jenkins: Open
http://<your-ip>:8080in your browser.- Default credentials:
- User:
admin - Password:
admin
- User:
- Default credentials:
-
Configure Clerk metadata:
- In your Clerk dashboard, go to Configure > Session.
- Under customization for
sessions, add:
{ "metadata": "{{user.public_metadata}}" }- It should look like this:
Note
The next step is optional
-
We advise for public deployment to create a production instance on your clerk dashboard. Please follow the relevent documentation : https://clerk.com/docs/deployments/overview
-
Set user permissions:
-
When connecting via GitHub, users will not have access by default.
-
Assign permissions in the metadata section for each user:
admin: Access to all projects.ftrace: Access to theftraceproject.zappy: Access to thezappyproject.- Multiple permissions can be assigned as a list.
-
Example for
adminpermission:
- Example for
ftracepermission:
- Example for multiple permissions:
-
-
Create an environment file in the
frontenddirectory:- Connect as the
apiuser (password:api) in Jenkins. - Create a new API Key at:
http://<your-ip>:8080/user/api/security/ - Go to the
frontenddirectory and create/edit the.envfile:
cd frontend nvim .env- Add the following variables:
JENKINS_URL=********** JENKINS_API_KEY=********** JENKINS_USER=********** # Should be api NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=********** CLERK_SECRET_KEY=********** NEXT_PUBLIC_PRODUCTION=********** # true or false NEXT_PUBLIC_JENKINS_URL=********** # Public jenkins url
- For more details on Clerk, see the wiki.
- Connect as the
-
Build the frontend:
docker compose build frontend --no-cache
-
Start the frontend:
docker compose up frontend -d
- The frontend will be available at:
http://<your-ip>:3000
- The frontend will be available at:
To run the tests on your private repository you need to add a ssh-key. So to do so you need to run this command inside the docker :
# Go inside the docker
docker exec -it jenkins-platypus zsh
# Generate a new ssh key
ssh-keygen
# Add github to your know-host list
ssh-keyscan github.com >> ~/.ssh/known_hostsPut the information you want.
When this is done you can now add this key to your Github account.
After you can now go into the new credentials settings and add a new ssh key :
Now for each job in the settings of the build you can select the credentials to use for this repo and then you select your ssh-key.
You can build your private project now.
I put a script protection to not execute everything i don't want on this jenkins.
So to be able to continue to the next step you need to accept the seed job script.
To do so you need to go into the settings and you will get a Approve and a Deny. I suggest you approve but this is up to you.
Important
The job will only run on the branch named main
So to run the job you first need to seed it. To do so you need to go into the seed job at the root of the jenkins.
You can build it with the name you want for the new job (the one the check will be done on), the directory the job will be inside of, and also the json file (Ex: ftrace for the ftrace.json).
Then You can find this job in the directory you specified.
When the job is build you will get a nice graph with the info if you :
passed: The test was successfullskipped: The isn't even run cause the build failedfailed: The test failed
To see the Github repository there is a github button. You can click on it and it will redirect you to the repository.
On the workspace part there is the log of the tests ran. And also the repository when it was clone.
You can also run the tests on the Frontend when you have the admin permission.
Caution
The job will fail if the repo just got created and no commits are made.
You can create a new JSON file for your personal project. Below is the required structure for the JSON file:
{
"test": {
"build": "make",
"tests": [
{
"Error-Handling": [
{
"name": "Bad argument server",
"command": "./exec this is not working",
"output": "*",
"return": 84
}
],
"Functionnal-Test": [
{
"name": "Should work",
"command": "./exec",
"output": "*",
"return": 0
}
]
}
]
}
}Here are the options available for each test:
grep: Use this to filter the output and extract the desired information.output: Specify the exact output expected (can be*to match anything).std: Indicates the standard output to search for the expected output.timeout: Sets the timeout duration in seconds; the default is 10 seconds.
Keeping your services up to date ensures you benefit from the latest features and security patches. Follow the steps below to update Jenkins or the frontend:
Rebuild and restart the Jenkins service to apply any changes:
docker compose build --no-cache jenkins
docker compose up jenkins -dFor the frontend, use the --no-cache flag to ensure a fresh build, then restart the service:
docker compose build --no-cache frontend
docker compose up frontend -dThis project is built with:
| Contributor | GitHub Profile |
|---|---|
| Skignes | |
| lg-epitech |
We welcome contributions! Please follow these guidelines:
- Use Conventional Commits for your commit messages.
-
For new features:
feat(scope): description
Example:
feat(corewar): add corewar test -
For bug fixes:
fix(scope): description
Example:
fix(build): resolve Dockerfile path issue
-
Feel free to open issues or submit pull requests to improve the project.
This project is licensed under the MIT License. See the LICENSE file for details.






