在我的项目中,部署脚本使用构建作业的结果,但我看到在我的部署作业中,GitLab CI 重新获取上次提交的所有更改,并且还删除了构建作业生成的所有文件。我正在使用外壳执行器。
有没有办法阻止 GitLab CI 在部署作业中执行此操作,以便我的部署可以从构建作业停止的地方继续?
我努力了:
cache:
untracked: true
Run Code Online (Sandbox Code Playgroud)
在我的部署工作中,但这似乎没有任何区别
我完整的 .gitlab-ci.yml 是:
before_script:
- sudo apt-get -y install default-jdk
- sudo add-apt-repository -y ppa:cwchien/gradle
- sudo apt-get -y update
- sudo apt-get -y install gradle
- curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
- sudo apt-get install -y nodejs
- sudo npm install -g pm2
stages:
- build
- test
- deploy
after_script:
jobBuild:
stage: build
script:
- ( cd my-lib; gradle build assemble)
only:
- …Run Code Online (Sandbox Code Playgroud) 我的应用程序基于使用 actix 和 actix-web 的库 (Library-A)。我正在添加第二个库(Library-B),它运行一个 http 服务器,也使用 actix-web。actix::system我为此使用了一个单独的线程。收到 SIGINT 后,仅 Library-B actix 系统关闭,而 Library-A 继续运行。后续 SIGINT 不会关闭正在运行的 actix 系统。
正常关闭两个正在运行的 actix 系统的正确方法是什么?
Library-B 的代码,用于启动新的 actix 系统并运行 http 服务器:
thread::spawn(move || {
let sys = actix::System::new("monitor");
server::new(|| App::new()
.route("/metrics", http::Method::GET, endpoint))
.bind(format!("0.0.0.0:{}", port))
.unwrap()
.start();
sys.run();
println!("Closing monitor actix system");
// --- SIGINT gets me here... how do I shut down gracefully?
});
Run Code Online (Sandbox Code Playgroud)
我为独立图书馆启动一个新系统是否正确?如何优雅地关闭?