forked from vieter-v/vieter
Moved config structs to more logical location
This commit is contained in:
parent
2aa2aa143c
commit
c656e672e2
5 changed files with 23 additions and 25 deletions
|
|
@ -3,7 +3,6 @@ module build
|
|||
import docker
|
||||
import encoding.base64
|
||||
import time
|
||||
import env
|
||||
import net.http
|
||||
import git
|
||||
import json
|
||||
|
|
@ -62,7 +61,7 @@ fn create_build_image() ?string {
|
|||
return image.id
|
||||
}
|
||||
|
||||
fn build(conf env.BuildConfig) ? {
|
||||
fn build(conf Config) ? {
|
||||
// We get the repos list from the Vieter instance
|
||||
mut req := http.new_request(http.Method.get, '$conf.address/api/repos', '') ?
|
||||
req.add_custom_header('X-Api-Key', conf.api_key) ?
|
||||
|
|
|
|||
|
|
@ -3,6 +3,12 @@ module build
|
|||
import cli
|
||||
import env
|
||||
|
||||
pub struct Config {
|
||||
pub:
|
||||
api_key string
|
||||
address string
|
||||
}
|
||||
|
||||
// cmd returns the cli submodule that handles the build process
|
||||
pub fn cmd() cli.Command {
|
||||
return cli.Command{
|
||||
|
|
@ -10,7 +16,7 @@ pub fn cmd() cli.Command {
|
|||
description: 'Run the build process.'
|
||||
execute: fn (cmd cli.Command) ? {
|
||||
config_file := cmd.flags.get_string('config-file') ?
|
||||
conf := env.load<env.BuildConfig>(config_file) ?
|
||||
conf := env.load<Config>(config_file) ?
|
||||
|
||||
build(conf) ?
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue