Skip to content

Commit af34ab3

Browse files
committed
Merge branch 'unstable' into stable
2 parents 48357b0 + ada721e commit af34ab3

32 files changed

+567
-201
lines changed

deploy-config.json renamed to .deploy-config.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,22 +1305,22 @@
13051305
"COPY .docker-fake-files/rust/lib.rs src/lib.rs",
13061306
"COPY .docker-fake-files/rust/main.rs src/main.rs",
13071307
"COPY Cargo.toml .",
1308-
"COPY deploy-config.json ."
1308+
"COPY .deploy-config.json ."
13091309
],
13101310
"pre_cache_cmds": [
1311-
"RUN /app/deployer run containered --current --containered --no-pipe"
1311+
"DEPL"
13121312
]
13131313
},
13141314
{
13151315
"copy_cmds": [
1316-
"COPY src/ src/"
1316+
"COPY src/ src/",
1317+
"COPY DOCS.en.md .",
1318+
"COPY DOCS.ru.md ."
13171319
],
13181320
"pre_cache_cmds": [
1319-
"COPY DOCS.en.md .",
1320-
"COPY DOCS.ru.md .",
13211321
"RUN touch src/main.rs",
13221322
"RUN touch src/lib.rs",
1323-
"RUN /app/deployer run containered --current --containered --no-pipe"
1323+
"DEPL"
13241324
]
13251325
}
13261326
]
@@ -1418,22 +1418,22 @@
14181418
"COPY .docker-fake-files/rust/lib.rs src/lib.rs",
14191419
"COPY .docker-fake-files/rust/main.rs src/main.rs",
14201420
"COPY Cargo.toml .",
1421-
"COPY deploy-config.json ."
1421+
"COPY .deploy-config.json ."
14221422
],
14231423
"pre_cache_cmds": [
1424-
"RUN /app/deployer run ru-containered --current --containered --no-pipe"
1424+
"DEPL"
14251425
]
14261426
},
14271427
{
14281428
"copy_cmds": [
1429-
"COPY src/ src/"
1429+
"COPY src/ src/",
1430+
"COPY DOCS.en.md .",
1431+
"COPY DOCS.ru.md ."
14301432
],
14311433
"pre_cache_cmds": [
1432-
"COPY DOCS.en.md .",
1433-
"COPY DOCS.ru.md .",
14341434
"RUN touch src/main.rs",
14351435
"RUN touch src/lib.rs",
1436-
"RUN /app/deployer run ru-containered --current --containered --no-pipe"
1436+
"DEPL"
14371437
]
14381438
}
14391439
]

deploy-config.toml renamed to .deploy-config.toml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,18 +1055,20 @@ copy_cmds = [
10551055
"COPY .docker-fake-files/rust/lib.rs src/lib.rs",
10561056
"COPY .docker-fake-files/rust/main.rs src/main.rs",
10571057
"COPY Cargo.toml .",
1058-
"COPY deploy-config.json .",
1058+
"COPY .deploy-config.toml .",
10591059
]
1060-
pre_cache_cmds = ["RUN /app/deployer run containered --current --containered --no-pipe"]
1060+
pre_cache_cmds = ["DEPL"]
10611061

10621062
[[pipelines.containered_opts.cache_strategies]]
1063-
copy_cmds = ["COPY src/ src/"]
1064-
pre_cache_cmds = [
1063+
copy_cmds = [
1064+
"COPY src/ src/",
10651065
"COPY DOCS.en.md .",
10661066
"COPY DOCS.ru.md .",
1067+
]
1068+
pre_cache_cmds = [
10671069
"RUN touch src/main.rs",
10681070
"RUN touch src/lib.rs",
1069-
"RUN /app/deployer run containered --current --containered --no-pipe",
1071+
"DEPL",
10701072
]
10711073

10721074
[[pipelines]]
@@ -1148,18 +1150,20 @@ copy_cmds = [
11481150
"COPY .docker-fake-files/rust/lib.rs src/lib.rs",
11491151
"COPY .docker-fake-files/rust/main.rs src/main.rs",
11501152
"COPY Cargo.toml .",
1151-
"COPY deploy-config.json .",
1153+
"COPY .deploy-config.toml .",
11521154
]
1153-
pre_cache_cmds = ["RUN /app/deployer run ru-containered --current --containered --no-pipe"]
1155+
pre_cache_cmds = ["DEPL"]
11541156

11551157
[[pipelines.containered_opts.cache_strategies]]
1156-
copy_cmds = ["COPY src/ src/"]
1157-
pre_cache_cmds = [
1158+
copy_cmds = [
1159+
"COPY src/ src/",
11581160
"COPY DOCS.en.md .",
11591161
"COPY DOCS.ru.md .",
1162+
]
1163+
pre_cache_cmds = [
11601164
"RUN touch src/main.rs",
11611165
"RUN touch src/lib.rs",
1162-
"RUN /app/deployer run ru-containered --current --containered --no-pipe",
1166+
"DEPL",
11631167
]
11641168

11651169
[[place_artifacts_into_project_root]]

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "deployer"
3-
version = "1.4.0-beta-2"
3+
version = "1.4.0-beta-3"
44
edition = "2024"
55

66
[dependencies]
@@ -16,6 +16,7 @@ fs_extra = "1.2"
1616
indicatif = "0.17"
1717
inquire = { optional = true, git = "https://github.com/markcda/inquire.git", branch = "feat/reorder-values", features = ["reorder"] }
1818
mimalloc = "0.1.43"
19+
nix = { version = "0.29", features = ["signal", "user"] }
1920
regex = "1.11"
2021
russh = "0.49"
2122
safe-path = "0.1"

DOCS.ru.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ deployer new content
463463
}
464464
```
465465

466-
#### 1.7. Другие действия - `Interrupt`, `Observe` и `Test`
466+
#### 1.7. Другие действия - `interrupt`, `observe` и `test`
467467

468468
> [!NOTE]
469469
> Нет нужного примера конфигурации? Создайте действие самостоятельно при помощи команды `deployer new action` и выведите его на экран при помощи `deployer cat action my-action@x.y.z`.

TODO.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# `deployer`'s TODO list
22

3-
- [ ] make requirement checks at remote hosts
4-
- [ ] maybe, make some `env` variable to set Deployer to execute only local actions
53
- [ ] make `Transfer` Actions to sync only selected files to and from remote
64
- [ ] make `deployer share content` command
75

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env python
2+
3+
import tomllib
4+
5+
with open('Cargo.toml', 'rb') as f:
6+
data = tomllib.load(f)
7+
print(data['package']['version'])

deploy-config.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -837,17 +837,19 @@ pipelines:
837837
- COPY .docker-fake-files/rust/lib.rs src/lib.rs
838838
- COPY .docker-fake-files/rust/main.rs src/main.rs
839839
- COPY Cargo.toml .
840-
- COPY deploy-config.json .
840+
- COPY deploy-config.yaml .
841841
pre_cache_cmds:
842-
- RUN /app/deployer run containered --current --containered --no-pipe
842+
- DEPL
843843
- copy_cmds:
844844
- COPY src/ src/
845-
pre_cache_cmds:
846845
- COPY DOCS.en.md .
847846
- COPY DOCS.ru.md .
847+
pre_cache_cmds:
848848
- RUN touch src/main.rs
849849
- RUN touch src/lib.rs
850-
- RUN /app/deployer run containered --current --containered --no-pipe
850+
- DEPL
851+
use_containerd_local_storage_cache: true
852+
prevent_metadata_loading: true
851853
exclusive_exec_tag: containered
852854
- title: ru-containered
853855
desc: Got from `Deployer Pipeline`.
@@ -911,18 +913,20 @@ pipelines:
911913
- COPY .docker-fake-files/rust/lib.rs src/lib.rs
912914
- COPY .docker-fake-files/rust/main.rs src/main.rs
913915
- COPY Cargo.toml .
914-
- COPY deploy-config.json .
916+
- COPY deploy-config.yaml .
915917
pre_cache_cmds:
916-
- RUN /app/deployer run ru-containered --current --containered --no-pipe
918+
- DEPL
917919
- copy_cmds:
918920
- COPY src/ src/
919-
pre_cache_cmds:
920921
- COPY DOCS.en.md .
921922
- COPY DOCS.ru.md .
923+
pre_cache_cmds:
922924
- RUN touch src/main.rs
923925
- RUN touch src/lib.rs
924-
- RUN /app/deployer run ru-containered --current --containered --no-pipe
925-
exclusive_exec_tag: containered
926+
- DEPL
927+
use_containerd_local_storage_cache: true
928+
prevent_metadata_loading: true
929+
exclusive_exec_tag: ru-containered
926930
artifacts:
927931
- target/release/deployer
928932
variables: []

src/actions/buildlike.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub type PostBuildAction = BuildAction;
5858

5959
impl Execute for BuildAction {
6060
/// Executes commands with given run environment.
61-
fn execute(&self, env: RunEnvironment) -> anyhow::Result<(bool, Vec<String>)> {
61+
fn execute(&self, env: &RunEnvironment) -> anyhow::Result<(bool, Vec<String>)> {
6262
let mut total_output = vec![];
6363

6464
for cmd in &self.commands {

src/actions/deploylike.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub type PostDeployAction = DeployAction;
4949

5050
impl Execute for DeployAction {
5151
/// Executes commands with given run environment.
52-
fn execute(&self, env: RunEnvironment) -> anyhow::Result<(bool, Vec<String>)> {
52+
fn execute(&self, env: &RunEnvironment) -> anyhow::Result<(bool, Vec<String>)> {
5353
let mut total_output = vec![];
5454

5555
for cmd in &self.commands {

src/actions/observe.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,21 @@ pub struct ObserveAction {
3131

3232
impl Execute for ObserveAction {
3333
/// Executes commands with given run environment without I/O redirection.
34-
fn execute(&self, env: RunEnvironment) -> anyhow::Result<(bool, Vec<String>)> {
35-
let mut observe_env = env;
34+
fn execute(&self, env: &RunEnvironment) -> anyhow::Result<(bool, Vec<String>)> {
35+
let mut observe_env = RunEnvironment {
36+
daemons: env.daemons.clone(),
37+
..(*env)
38+
};
3639
observe_env.no_pipe = true;
37-
self.command.execute(observe_env)
40+
self.command.execute(&observe_env)
3841
}
3942

40-
fn execute_observer(&self, env: RunEnvironment) -> anyhow::Result<(bool, Vec<String>)> {
41-
let mut observe_env = env;
43+
fn execute_observer(&self, env: &RunEnvironment) -> anyhow::Result<(bool, Vec<String>)> {
44+
let mut observe_env = RunEnvironment {
45+
daemons: env.daemons.clone(),
46+
..(*env)
47+
};
4248
observe_env.no_pipe = true;
43-
self.command.execute_observer(observe_env)
49+
self.command.execute_observer(&observe_env)
4450
}
4551
}

0 commit comments

Comments
 (0)