1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use tokio::process::Command;

pub async fn process_build(service_name: &str, project_id: &str) {
  let gcr_url = String::from("eu.gcr.io/") + project_id + "/" + service_name;
  let output = Command::new("gcloud")
    .args(&["builds", "submit", "--tag", &gcr_url, "--timeout=80000"])
    .output()
    .await;
  println!("output = {:?}", output);
}

pub async fn process_deploy(service_name: &str, project_id: &str) {
  let img_url = String::from("eu.gcr.io/") + project_id + "/" + service_name;
  println!("{}", &img_url);
  let output = Command::new("gcloud")
    .args(&["run", "deploy", "--image", &img_url])
    .output()
    .await;
  println!("output = {:?}", output);
}