View hcl-simple-example-1.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"github.com/hashicorp/hcl/v2/hclsimple" | |
) | |
var ( |
View hcl-simple-example-2.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"github.com/hashicorp/hcl/v2" | |
"github.com/hashicorp/hcl/v2/gohcl" | |
"github.com/hashicorp/hcl/v2/hclsimple" | |
) |
View medium-post-hcl-1.hcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task "first_task" { | |
exec "list_current_dir" { | |
command = "ls ." | |
} | |
exec "list_var_dir" { | |
command = "ls /var" | |
} | |
} |
View medium-post-hcl-2.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Config struct { | |
Tasks []*Task `hcl:"task,block"` | |
} | |
type Task struct { | |
Name string `hcl:"name,label"` | |
Steps []*ExecStep `hcl:"exec,block"` | |
} | |
type ExecStep struct { | |
Name string `hcl:"name,label"` |
View medium-post-hcl-3.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"fmt" | |
"os" | |
"github.com/hashicorp/hcl/v2/hclsimple" | |
) | |
var ( | |
exampleHCL = ` | |
task "first_task" { | |
exec "list_current_dir" { |
View medium-post-hcl-4.hcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task "first_task" { | |
mkdir "build_dir" { | |
path = "./build" | |
} | |
exec "list_var_dir" { | |
command = "ls /var" | |
} | |
} |
View medium-post-hcl-5.hcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Task struct { | |
Name string `hcl:"name,label"` | |
ExecSteps []*ExecStep `hcl:"exec,block"` | |
MkdirStep []*MkdirStep `hcl:"mkdir,block"` | |
} |
View medium-post-hcl-6.hcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task "first_task" { | |
step "mkdir" "build_dir" { | |
path = "./build/" | |
} | |
step "exec" "list_build_dir" { | |
command = "ls ./build/" | |
} | |
} |
View medium-post-hcl-7.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Config struct { | |
Tasks []*Task `hcl:"task,block"` | |
} | |
type Task struct { | |
Name string `hcl:"name,label"` | |
Steps []*Step `hcl:"step,block"` | |
} | |
type Step struct { |
View medium-post-hcl-8.hcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Runner interface { | |
Run() error | |
} |
OlderNewer