refactor(console): renamed stuff to 'targets'

main
Jef Roosens 2022-06-14 20:38:20 +02:00 committed by Jef Roosens
parent 4d581da7bf
commit faec08f846
Signed by untrusted user: Jef Roosens
GPG Key ID: B580B976584B5F30
3 changed files with 14 additions and 14 deletions

View File

@ -1,11 +1,11 @@
module git
module targets
import client
import docker
import os
import build
// build builds every Git repo in the server's list.
// build locally builds the target with the given id.
fn build(conf Config, repo_id int) ? {
c := client.new(conf.address, conf.api_key)
repo := c.get_target(repo_id)?

View File

@ -1,4 +1,4 @@
module git
module targets
import cli
import vieter.vconf
@ -16,12 +16,12 @@ struct Config {
// cmd returns the cli submodule that handles the repos API interaction
pub fn cmd() cli.Command {
return cli.Command{
name: 'repos'
description: 'Interact with the repos API.'
name: 'targets'
description: 'Interact with the targets API.'
commands: [
cli.Command{
name: 'list'
description: 'List the current repos.'
description: 'List the current targets.'
flags: [
cli.Flag{
name: 'limit'
@ -35,7 +35,7 @@ pub fn cmd() cli.Command {
},
cli.Flag{
name: 'repo'
description: 'Only return Git repos that publish to this repo.'
description: 'Only return targets that publish to this repo.'
flag: cli.FlagType.string
},
]
@ -67,7 +67,7 @@ pub fn cmd() cli.Command {
name: 'add'
required_args: 3
usage: 'url branch repo'
description: 'Add a new repository.'
description: 'Add a new Git repository target.'
execute: fn (cmd cli.Command) ? {
config_file := cmd.flags.get_string('config-file')?
conf := vconf.load<Config>(prefix: 'VIETER_', default_path: config_file)?
@ -79,7 +79,7 @@ pub fn cmd() cli.Command {
name: 'remove'
required_args: 1
usage: 'id'
description: 'Remove a repository that matches the given ID prefix.'
description: 'Remove a target that matches the given id.'
execute: fn (cmd cli.Command) ? {
config_file := cmd.flags.get_string('config-file')?
conf := vconf.load<Config>(prefix: 'VIETER_', default_path: config_file)?
@ -91,7 +91,7 @@ pub fn cmd() cli.Command {
name: 'info'
required_args: 1
usage: 'id'
description: 'Show detailed information for the repo matching the ID prefix.'
description: 'Show detailed information for the target matching the id.'
execute: fn (cmd cli.Command) ? {
config_file := cmd.flags.get_string('config-file')?
conf := vconf.load<Config>(prefix: 'VIETER_', default_path: config_file)?
@ -103,7 +103,7 @@ pub fn cmd() cli.Command {
name: 'edit'
required_args: 1
usage: 'id'
description: 'Edit the repository that matches the given ID prefix.'
description: 'Edit the Git repository target that matches the given id.'
flags: [
cli.Flag{
name: 'url'
@ -152,7 +152,7 @@ pub fn cmd() cli.Command {
name: 'build'
required_args: 1
usage: 'id'
description: 'Build the repo with the given id & publish it.'
description: 'Build the target with the given id & publish it.'
execute: fn (cmd cli.Command) ? {
config_file := cmd.flags.get_string('config-file')?
conf := vconf.load<Config>(prefix: 'VIETER_', default_path: config_file)?

View File

@ -3,7 +3,7 @@ module main
import os
import server
import cli
import console.git
import console.targets
import console.logs
import console.schedule
import console.man
@ -26,7 +26,7 @@ fn main() {
]
commands: [
server.cmd(),
git.cmd(),
targets.cmd(),
cron.cmd(),
logs.cmd(),
schedule.cmd(),