test: config search path (using docker)
This commit is contained in:
parent
1b5c48071c
commit
6e85e12993
@ -10,7 +10,8 @@
|
|||||||
"dustypomerleau.rust-syntax",
|
"dustypomerleau.rust-syntax",
|
||||||
"1YiB.rust-bundle",
|
"1YiB.rust-bundle",
|
||||||
"serayuzgur.crates",
|
"serayuzgur.crates",
|
||||||
"tamasfe.even-better-toml"
|
"tamasfe.even-better-toml",
|
||||||
|
"ms-azuretools.vscode-docker"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
9
docker/Dockerfile
Normal file
9
docker/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
ADD target/debug/init /usr/local/bin/init
|
||||||
|
ADD docker/ /
|
||||||
|
|
||||||
|
RUN chmod ugo+x /etc/wingmate/services/one && chmod ugo+x /etc/wingmate/services/two.sh && \
|
||||||
|
chmod ugo-x /etc/wingmate/services/three.sh
|
||||||
|
|
||||||
|
CMD [ "/usr/local/bin/init" ]
|
||||||
0
docker/entry.sh
Normal file
0
docker/entry.sh
Normal file
3
docker/etc/wingmate/services/one
Normal file
3
docker/etc/wingmate/services/one
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
exec sleep 1
|
||||||
3
docker/etc/wingmate/services/three.sh
Normal file
3
docker/etc/wingmate/services/three.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
exec sleep 1
|
||||||
3
docker/etc/wingmate/services/two.sh
Normal file
3
docker/etc/wingmate/services/two.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
exec sleep 1
|
||||||
@ -6,5 +6,6 @@ use std::error as std_err;
|
|||||||
|
|
||||||
pub async fn start() -> Result<(), Box<dyn std_err::Error>> {
|
pub async fn start() -> Result<(), Box<dyn std_err::Error>> {
|
||||||
let _config = config::Config::find(vec![String::from("/etc/wingmate")])?;
|
let _config = config::Config::find(vec![String::from("/etc/wingmate")])?;
|
||||||
|
dbg!(_config);
|
||||||
daemon::start().await
|
daemon::start().await
|
||||||
}
|
}
|
||||||
@ -4,11 +4,13 @@ use std::error as std_error;
|
|||||||
use crate::init::error as wingmate_error;
|
use crate::init::error as wingmate_error;
|
||||||
use nix::unistd::{access, AccessFlags};
|
use nix::unistd::{access, AccessFlags};
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub enum Command {
|
pub enum Command {
|
||||||
ShellPrefixed(String),
|
ShellPrefixed(String),
|
||||||
Direct(String)
|
Direct(String)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
pub services: Vec<Command>,
|
pub services: Vec<Command>,
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user