220527 OndeDev piplines
Kjell Bovin edited this page Jun 2, 2022
·
2 revisions
2022-05-27
Onedev is a self-hosted Git server with Kanban and CI/CD. Here is a description of how to set up Onedev and define a simple pipeline with lint and pep8 to check the code quality. If there are deviations in the code, they are automatically corrected with autopep8
- Docker
- Docker-compose
Clone or copy the code from the repository. In OneDev folder:
docker-compose up
- Go to http://localhost:6610
- Create Administrator Account
- Enter Name, Password and e-mailadress
- Next
- Finish
- Click add project
- Name the project Test-project
- Click Create
Start a new terminal in OneDev folder and push the repository to OneDev
git remote add onedev http://localhost:6610/Test-project
git push onedev
- Log in to the website to see that all 5 builds failed.
- In the OneDev menu, click Administration and click Job Excursions.
- Click Add Executor
Select Server Docker Executor and enter name:
localhost-docker
- Save
Make some changes in src/main.py and push
git add .
git commit -m "FUNKA.NU"
git push
This is so that autopep8 can make changes to the code and be able to push up to the repo itself.
- Click on admin link at the top right corner
- Click on Access Token
- Click the copy to clipboard button
- Click the OneDev icon in the top left corner
- Click on your Test-project
- Click Settings in the bottom left corner
- Click on Job Secrets
- Click the button Add new secret
Name: onedev-token
Value: The access-token copied to the clipboard