Added some documentation; ran format
Some checks failed
ci/woodpecker/push/deploy unknown status
ci/woodpecker/push/docker unknown status
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Jef Roosens 2022-02-20 22:15:10 +01:00
parent 36693900a3
commit 9cc88e629f
Signed by: Jef Roosens
GPG key ID: B580B976584B5F30
4 changed files with 24 additions and 11 deletions

View file

@ -11,7 +11,9 @@ import git
const container_build_dir = '/build'
fn build(key string, repo_dir string) ? {
server_url := os.getenv_opt('VIETER_ADDRESS') or { exit_with_message(1, 'No Vieter server address was provided.') }
server_url := os.getenv_opt('VIETER_ADDRESS') or {
exit_with_message(1, 'No Vieter server address was provided.')
}
// Read in the repos from a json file
filename := os.join_path_single(repo_dir, 'repos.json')
@ -22,14 +24,14 @@ fn build(key string, repo_dir string) ? {
// Update repos & install required packages
'pacman -Syu --needed --noconfirm base-devel git'
// Add a non-root user to run makepkg
'groupadd -g 1000 builder'
'groupadd -g 1000 builder',
'useradd -mg builder builder'
// Make sure they can use sudo without a password
"echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers"
// Create the directory for the builds & make it writeable for the
// build user
'mkdir /build'
'chown -R builder:builder /build'
'mkdir /build',
'chown -R builder:builder /build',
]
// Each repo gets a unique UUID to avoid naming conflicts when cloning