Skip to content

Commit

Permalink
start to switch to hcl
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhou121 committed Apr 13, 2024
1 parent 714ff1d commit 7038b48
Show file tree
Hide file tree
Showing 19 changed files with 1,267 additions and 419 deletions.
100 changes: 100 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ members = [
]

[workspace.dependencies]
hcl-rs = "0.16.8"
hcl-edit = "0.7.6"
tempfile = "3.10.1"
os_info = "3.7"
itertools = "0.12.1"
Expand Down
9 changes: 9 additions & 0 deletions examples/example_tiron_project/jobs/job1/main.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
job "job1" {
action "copy" {
name = "the first action"
params {
src = "/tmp/test.rcl"
dest = "/tmp/test.conf"
}
}
}
69 changes: 69 additions & 0 deletions examples/example_tiron_project/main.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// use "jobs/job1/main.tr" {
// job "job1" {
// as = "another_job_name"
// }
// job "job2" {}
// }

use "tiron.tr" {
group "group2" {}
}

group "production" {
host "localhost" {
apache = "apache2"
}
}

run "production" {
name = "initial run"
remote_user = "dz"
become = true

action "copy" {
params {
src = "/tmp/test.rcl"
dest = "/tmp/test.conf"
}
}

action "package" {
params {
name = [apache, "mariadb-connector-c", "${apache}"]
state = "present"
}
}

action "job" {
name = "run job1"
params {

}
}
}

run "group2" {
remote_user = "dz"

action "job" {
params {
name = "job1"
}
}
action "copy" {
params {
src = "/tmp/test.rcl"
dest = "/tmp/test.conf"
}
}
action "job" {
params {
name = "job1"
}
}
action "job" {
params {
name = "job1"
}
}
}
17 changes: 17 additions & 0 deletions examples/example_tiron_project/tiron.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
group "group1" {
host "machine1" {}
}

group "group2" {
host "machine1" {
var1 = "machine1_var1"
}

group "group1" {
var3 = "var3"
}

apache = "apache2"
var1 = "var1"
var2 = "var2"
}
2 changes: 2 additions & 0 deletions tiron-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ version.workspace = true
edition.workspace = true

[dependencies]
hcl-rs = { workspace = true }
hcl-edit = { workspace = true }
itertools = { workspace = true }
tempfile = { workspace = true }
serde_json = { workspace = true }
Expand Down
Loading

0 comments on commit 7038b48

Please sign in to comment.