...
 
Commits (2)
......@@ -4,13 +4,13 @@ version = "0.1.0"
authors = ["guimoz <rezo@guimoz.fr>"]
[dependencies]
diesel = { version = "1.2.*", features = ["postgres"] }
diesel = { version = "1.3.*", features = ["postgres"] }
dotenv = "0.9.0"
rand = "0.4"
systemd = "~0.2"
serde = "*"
serde_derive = "*"
serde_json = "*"
rocket = "0.3.*"
rocket_codegen = "=0.3.*"
rocket_contrib = "=0.3.*"
rocket = "0.4.*"
# rocket_codegen = "=0.4.*"
rocket_contrib = "=0.4.*"
nightly-2018-05-14
nightly-2019-01-09
......@@ -41,8 +41,8 @@ fn main() -> std::io::Result<()> {
file.push_str(&container.nom);
file.push_str(&"/docker-compose.yml");
login_registry(&data,&folder);
write_secrets(&data,folder);
update(&file);
write_secrets(&data,&folder);
update(&file,&folder);
activate_compose(&file,&data);
}
None => (),
......@@ -56,8 +56,8 @@ fn main() -> std::io::Result<()> {
Ok(())
}
fn write_secrets(data: &Data, folder: String) -> std::io::Result<()>{
let env = folder+"/secrets.env";
fn write_secrets(data: &Data, folder: &str) -> std::io::Result<()>{
let env = folder.to_owned()+"/secrets.env";
println!("{:?}", env);
let mut buffer = File::create(&env)?;
for (key,val) in data.secrets.iter(){
......@@ -77,9 +77,10 @@ fn activate_compose(path: &str, data: &Data) -> bool {
return output.status.success();
}
fn update(path: &str){
fn update(path: &str, folder: &str){
// println!("Starting update");
let mut output = Command::new("docker-compose")
.env("HOME",folder)
// .args(&["-f", path, "pull"])
.arg("-f")
.arg(path)
......
#![feature(plugin)]
#![plugin(rocket_codegen)]
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use] extern crate rocket;
extern crate rocket_contrib;
extern crate ordonnanceur;
extern crate rocket;
use rocket::response::status;
use rocket_contrib::Json;
use rocket_contrib::json::Json;
use self::ordonnanceur::*;
use std::os::unix::net::UnixStream;
use std::io::prelude::*;
......