Repos are now read from a json file
parent
941b30e7d2
commit
138386682d
17
src/build.v
17
src/build.v
|
@ -5,20 +5,19 @@ import encoding.base64
|
||||||
import rand
|
import rand
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
|
import json
|
||||||
|
import git
|
||||||
|
|
||||||
const container_build_dir = '/build'
|
const container_build_dir = '/build'
|
||||||
|
|
||||||
struct GitRepo {
|
|
||||||
url string [required]
|
|
||||||
branch string [required]
|
|
||||||
}
|
|
||||||
|
|
||||||
fn build(key string, repo_dir string) ? {
|
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.') }
|
||||||
repos := [
|
|
||||||
GitRepo{'https://git.rustybever.be/Chewing_Bever/st', 'master'}
|
// Read in the repos from a json file
|
||||||
GitRepo{'https://aur.archlinux.org/libxft-bgra.git', 'master'}
|
filename := os.join_path_single(repo_dir, 'repos.json')
|
||||||
]
|
txt := os.read_file(filename) ?
|
||||||
|
repos := json.decode([]git.GitRepo, txt) ?
|
||||||
|
|
||||||
mut commands := [
|
mut commands := [
|
||||||
// Update repos & install required packages
|
// Update repos & install required packages
|
||||||
'pacman -Syu --needed --noconfirm base-devel git'
|
'pacman -Syu --needed --noconfirm base-devel git'
|
||||||
|
|
Loading…
Reference in New Issue