refactor: use new module names

dev
Jef Roosens 2022-06-22 09:18:47 +02:00
parent d060366dcb
commit 461f227169
Signed by untrusted user: Jef Roosens
GPG Key ID: B75D4F293C7052DB
8 changed files with 19 additions and 19 deletions

View File

@ -1,6 +1,6 @@
module build module build
import vieter.vdocker as docker import vieter_v.docker
import encoding.base64 import encoding.base64
import time import time
import os import os
@ -59,13 +59,13 @@ pub fn create_build_image(base_image string) ?string {
// We pull the provided image // We pull the provided image
dd.pull_image(image_name, image_tag)? dd.pull_image(image_name, image_tag)?
id := dd.create_container(c)?.id id := dd.container_create(c)?.id
// id := docker.create_container(c)? // id := docker.create_container(c)?
dd.start_container(id)? dd.container_start(id)?
// This loop waits until the container has stopped, so we can remove it after // This loop waits until the container has stopped, so we can remove it after
for { for {
data := dd.inspect_container(id)? data := dd.container_inspect(id)?
if !data.state.running { if !data.state.running {
break break
@ -80,7 +80,7 @@ pub fn create_build_image(base_image string) ?string {
// conflicts. // conflicts.
tag := time.sys_mono_now().str() tag := time.sys_mono_now().str()
image := dd.create_image_from_container(id, 'vieter-build', tag)? image := dd.create_image_from_container(id, 'vieter-build', tag)?
dd.remove_container(id)? dd.container_remove(id)?
return image.id return image.id
} }
@ -125,25 +125,25 @@ pub fn build_target(address string, api_key string, base_image_id string, target
user: '0:0' user: '0:0'
} }
id := dd.create_container(c)?.id id := dd.container_create(c)?.id
dd.start_container(id)? dd.container_start(id)?
mut data := dd.inspect_container(id)? mut data := dd.container_inspect(id)?
// This loop waits until the container has stopped, so we can remove it after // This loop waits until the container has stopped, so we can remove it after
for data.state.running { for data.state.running {
time.sleep(1 * time.second) time.sleep(1 * time.second)
data = dd.inspect_container(id)? data = dd.container_inspect(id)?
} }
mut logs_stream := dd.get_container_logs(id)? mut logs_stream := dd.container_get_logs(id)?
// Read in the entire stream // Read in the entire stream
mut logs_builder := strings.new_builder(10 * 1024) mut logs_builder := strings.new_builder(10 * 1024)
util.reader_to_writer(mut logs_stream, mut logs_builder)? util.reader_to_writer(mut logs_stream, mut logs_builder)?
dd.remove_container(id)? dd.container_remove(id)?
return BuildResult{ return BuildResult{
start_time: data.state.start_time start_time: data.state.start_time

View File

@ -1,7 +1,7 @@
module logs module logs
import cli import cli
import vieter.vconf import vieter_v.conf as vconf
import client import client
import console import console
import time import time

View File

@ -1,7 +1,7 @@
module targets module targets
import client import client
import vieter.vdocker as docker import vieter_v.docker
import os import os
import build import build

View File

@ -1,7 +1,7 @@
module targets module targets
import cli import cli
import vieter.vconf import vieter_v.conf as vconf
import cron.expression { parse_expression } import cron.expression { parse_expression }
import client { NewTarget } import client { NewTarget }
import console import console

View File

@ -1,7 +1,7 @@
module cron module cron
import cli import cli
import vieter.vconf import vieter_v.conf as vconf
struct Config { struct Config {
pub: pub:

View File

@ -6,7 +6,7 @@ import datatypes { MinHeap }
import cron.expression { CronExpression, parse_expression } import cron.expression { CronExpression, parse_expression }
import math import math
import build import build
import vieter.vdocker as docker import vieter_v.docker
import os import os
import client import client
import models { Target } import models { Target }

View File

@ -1,7 +1,7 @@
module server module server
import cli import cli
import vieter.vconf import vieter_v.conf as vconf
struct Config { struct Config {
pub: pub:

View File

@ -1,6 +1,6 @@
Module { Module {
dependencies: [ dependencies: [
'https://git.rustybever.be/vieter/vconf', 'https://git.rustybever.be/vieter-v/conf',
'https://git.rustybever.be/vieter/vdocker' 'https://git.rustybever.be/vieter-v/docker'
] ]
} }