mirror of
https://github.com/YunoHost/yunorunner.git
synced 2024-09-03 20:05:52 +02:00
Update README.md
This commit is contained in:
parent
d233bff9d5
commit
3917207541
1 changed files with 25 additions and 90 deletions
111
README.md
111
README.md
|
@ -1,93 +1,38 @@
|
|||
WIP CI runner for YunoHost.
|
||||
|
||||
# Installation
|
||||
|
||||
You need python 3.6 for that. The simpliest way to get it is to uses [pythonz](https://bettercallsaghul.com/pythonz/) if it's not available in your distribution.
|
||||
It's recommended to use : https://github.com/YunoHost-Apps/yunorunner_ynh
|
||||
|
||||
#### Getting python 3.6 (skip if you already have it)
|
||||
|
||||
Install pythonz:
|
||||
|
||||
curl -kL https://raw.githubusercontent.com/saghul/pythonz/master/pythonz-install | bash
|
||||
|
||||
# add tis to your .bashrc
|
||||
[[ -s $HOME/.pythonz/etc/bashrc ]] && source $HOME/.pythonz/etc/bashrc
|
||||
|
||||
Now install python 3.6:
|
||||
|
||||
pythonz install 3.6.6
|
||||
|
||||
#### installing yunorunner
|
||||
|
||||
You need virtualenv and sqlite:
|
||||
|
||||
sudo apt-get install python-virtualenv sqlite3
|
||||
|
||||
Download the source code:
|
||||
But you can also install stuff manually .... :
|
||||
|
||||
```bash
|
||||
cd /var/www/
|
||||
git clone https://github.com/YunoHost/yunorunner
|
||||
cd yunorunner
|
||||
python3 -m venv venv
|
||||
venv/bin/pip install -r requirements.txt
|
||||
```
|
||||
|
||||
Install dependancies:
|
||||
In either cases, you probably want to run the `finish_install.sh` script in `maintenance/`
|
||||
|
||||
virtualenv -p $(pythonz locate 3.6.6) ve3
|
||||
ve3/bin/pip install -r requirements.txt
|
||||
The configuration happens in `config.py` and typically looks like :
|
||||
|
||||
And that's it.
|
||||
|
||||
# Usage
|
||||
|
||||
### Server
|
||||
|
||||
Simple usage:
|
||||
|
||||
ve3/bin/python ./run.py /path/to/analyseCI.sh
|
||||
|
||||
This will start the server which will listen on http://localhost:4242
|
||||
|
||||
If you don't want to CI to monitor the app list you can ask it using the `-d` option:
|
||||
|
||||
ve3/bin/python ./run.py /path/to/analyseCI.sh -d
|
||||
|
||||
You can also disable git monitoring and the monthly jobs:
|
||||
|
||||
ve3/bin/python ./run.py /path/to/analyseCI.sh --dont-monitor-git --no-monthly-jobs
|
||||
|
||||
You can also specify the CI type this way:
|
||||
|
||||
ve3/bin/python ./run.py /path/to/analyseCI.sh -d -t arm
|
||||
# or
|
||||
ve3/bin/python ./run.py /path/to/analyseCI.sh -d -t testing-unstable
|
||||
|
||||
The default value is `stable`.
|
||||
|
||||
Current behavior:
|
||||
|
||||
* for stable : launch job as `$app_id ($app_list_name)`
|
||||
* for arm : launch job as `$app_id ($app_list_name) (~ARM~)`
|
||||
* for stable : launch TWO jobs as `$app_id ($app_list_name) (testing)` and `$app_id ($app_list_name) (unstable)`
|
||||
|
||||
#### Changing the port
|
||||
|
||||
If you need to change to port on which yunorunner is listening, you can simply uses the `--port` cli argument like that:
|
||||
|
||||
ve3/bin/python ./run.py /path/to/analyseCI.sh --port 4343
|
||||
|
||||
##### SSL
|
||||
|
||||
If you need this server to be front (without nginx in front of it) you can start it like that:
|
||||
|
||||
ve3/bin/python ./run.py /path/to/analyseCI.sh --ssl
|
||||
|
||||
It will try to find the "key.pem" and "crt.pem" at /etc/yunohost/certs/ci-apps.yunohost.org/key.pem and /etc/yunohost/certs/ci-apps.yunohost.org/crt.pem (this is "ci-apps" container configuration on bearnaise LXC).
|
||||
|
||||
This can be changed this way:
|
||||
|
||||
ve3/bin/python ./run.py /path/to/analyseCI.sh --ssl -k /path/to/key.pem -c /path/to/cert.pem
|
||||
```
|
||||
BASE_URL = "https://ci-apps-foobar.yunohost.org/ci"
|
||||
PORT = 34567
|
||||
PATH_TO_ANALYZER = "/var/www/yunorunner/analyze_yunohost_app.sh"
|
||||
MONITOR_APPS_LIST = True
|
||||
MONITOR_GIT = True
|
||||
MONITOR_ONLY_GOOD_QUALITY_APPS = True
|
||||
MONTHLY_JOBS = True
|
||||
WORKER_COUNT = 1
|
||||
YNH_BRANCH = "unstable"
|
||||
DIST = "bullseye"
|
||||
```
|
||||
|
||||
### Cli tool
|
||||
|
||||
The cli tool is called "ciclic" because my humour is legendary.
|
||||
The cli tool is called "ciclic" because my (Bram ;)) humour is legendary.
|
||||
|
||||
Basic tool signature:
|
||||
|
||||
|
@ -100,16 +45,6 @@ This tool works by doing a http request to the CI instance of you choice, by
|
|||
default the domain is "http://localhost:4242", you cand modify this for EVERY
|
||||
command by add "-d https://some.other.domain.com/path/".
|
||||
|
||||
##### Configuration
|
||||
|
||||
Because it does request other HTTP, this tool needs configuration for authentification. To do that, you need to do 2 thinks:
|
||||
|
||||
* generate a random token, for example using: `< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-80};echo;>`
|
||||
* on the place where the CLI TOOL is installed, at the same place that "ciclic", put this password in a file named `token`
|
||||
* on the place where the SERVER (run.py) is running, place this token in a file name `tokens` (with a S at the end), one token per line.
|
||||
|
||||
That's it.
|
||||
|
||||
##### Usage
|
||||
|
||||
Adding a new job:
|
||||
|
@ -175,6 +110,6 @@ similar).
|
|||
|
||||
# Licence
|
||||
|
||||
Agplv3+
|
||||
AGPL v3+
|
||||
|
||||
Copyright YunoHost 2018 (you can find the authors in the commits)
|
||||
|
|
Loading…
Add table
Reference in a new issue