76 lines
2.7 KiB
Plaintext
76 lines
2.7 KiB
Plaintext
Notes Version 4
|
|
|
|
Use a "config.toml" to specify repos to pull and build from.
|
|
Will probably have entries like:
|
|
|
|
[[project]]
|
|
clone_url = "https://github.com/username/project.git"
|
|
[[project]]
|
|
clone_url = "https://github.com/username/project2.git"
|
|
always_approve = true
|
|
[[user]]
|
|
username = "somebody"
|
|
password_hash = "..."
|
|
password_salt = "..."
|
|
permissions = ["view_project"]
|
|
[[user]]
|
|
username = "another_person"
|
|
password_hash = "..."
|
|
password_salt = "..."
|
|
otp_secret = "..."
|
|
permissions = ["add_project", "view_project"]
|
|
[[user]]
|
|
username = "someone_else"
|
|
password_hash = "..."
|
|
password_salt = "..."
|
|
otp_secret = "..."
|
|
permissions = ["create_user", "create_admin", "add_project", "remove_project", "view_project", "approve_deny_build"]
|
|
|
|
The project should have a "/.simple_ci/" at HEAD. There should be a
|
|
"/.simple_ci/build.toml" with entries like:
|
|
|
|
# The root directory refers to the root of the project for "working_directory".
|
|
# If the "working_directory" doesn't exist, simple_ci should create it first.
|
|
# It will probably use something like "/usr/bin/mkdir -p ...".
|
|
working_directory = "/build"
|
|
build_artifacts = ["./the_executable", "./docs/"]
|
|
build_steps = ["prepare_cmds", "build_cmds", "post_build_cmds"]
|
|
[[prepare_cmds]]
|
|
cmd = "./prepare.sh"
|
|
args = []
|
|
[[build_cmds]]
|
|
cmd = "/usr/bin/make"
|
|
args = ["all"]
|
|
[[build_cmds]]
|
|
cmd = "./test.sh"
|
|
args = []
|
|
[[build_cmds]]
|
|
cmd = "./not_important_test.sh"
|
|
args = []
|
|
allow_fail = true
|
|
[[post_build_cmds]]
|
|
cmd = "/usr/bin/make"
|
|
args = ["docs"]
|
|
[[post_build_cmds]]
|
|
cmd = "/usr/bin/cp"
|
|
args = ["./output/the_exe", "./the_executable"]
|
|
|
|
The simple_ci server should store "build.toml" entries from configured project
|
|
repos for approval by an administrator before doing anything with them. Ideally,
|
|
this will be done on a front-end website that requires login and shows the
|
|
"build.toml" from each configured project repo for approval or denial. The
|
|
back-end should store the approved "build.toml" per each repo so that the next
|
|
time the ci runs, it will verify that the files match. Any changes will require
|
|
the administrator to re-approve that repo's "build.toml". A single repository
|
|
will only have a single "build.toml" stored for it (assuming it was approved).
|
|
|
|
Ideally, the front-end would also enable the administrator to add/remove repos
|
|
to load from and build. This should enable editing the server-side "config.toml"
|
|
from this front-end as well.
|
|
|
|
If any of the commands specified in the projects "build.toml" fails, then
|
|
simple_ci should halt the "build" and leave a note to be viewed on the
|
|
front-end. Note that a cmd specified in a project's "build.toml" can set
|
|
"allow_fail = true" which will ignore failure for that specific command. Success
|
|
statuses should also be noted on the front-end.
|