Skip to content

Commit

Permalink
Merge pull request #19 from srevinsaju/feature/docker-ports
Browse files Browse the repository at this point in the history
Feature/docker ports
  • Loading branch information
srevinsaju authored Jun 22, 2023
2 parents 24bef6e + eaa210b commit 5cd71f8
Show file tree
Hide file tree
Showing 38 changed files with 1,149 additions and 986 deletions.
2 changes: 1 addition & 1 deletion cmd/togomak/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func newConfigFromCliContext(ctx *cli.Context) orchestra.Config {
func run(ctx *cli.Context) error {
cfg := newConfigFromCliContext(ctx)

orchestra.Orchestra(cfg)
os.Exit(orchestra.Orchestra(cfg))
return nil
}

Expand Down
18 changes: 12 additions & 6 deletions docs/src/configuration/data_git.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ data "git" "this" {
- [`url`](#url) - The URL of the repository to clone
- [`tag`](#tag) - The tag to checkout
- [`branch`](#branch) - The branch to checkout
- [`destination`](#destination) - The destination directory to clone the repository to, defaults to `"memory"`, which clones into memory
- [`destination`](#destination) - The destination directory to clone the repository to, defaults to `"memory"`, which clones into a temporary directory managed by `togomak`
- [`commit`](#commit) - The commit to checkout
- [`depth`](#depth) - The depth of the clone
- [`ca_bundle`](#ca_bundle) - The path to a CA bundle file or directory
- [`ca_bundle`](#ca_bundle) - The path to a CA bundle file or directory, (deprecated, does nothing).
- [`auth`](#auth) - The authentication credentials to use when cloning the repository. Structure [documented below](#auth)
- [`files`](#files) - The files to checkout from the repository. Accepts an array of file paths.

Expand All @@ -39,10 +39,16 @@ data "git" "this" {
- [`sha`](#sha) - The SHA of the commit, defaults to `""`
- [`ref`](#ref) - The ref of the commit, in the format `refs/heads/<branch>` or `refs/tags/<tag>`, defaults to `""`
- [`is_tag`](#is-tag) - Whether the ref is a tag, defaults to `false`
- [`is_branch`](#is-branch) - Whether the ref is a branch, defaults to `false`
- [`is_note`](#is-note) - Whether the ref is a note, defaults to `false`
- [`is_remote`](#is-remote) - Whether the ref is remote, defaults to `false`
- [`files`](#files) - The files checked out from the repository. Returns a map, with the keys being the file paths and the values being the file contents.
- [`branch`](#branch) - The branch checked out from the repository. Returns a string.
- [`tag`](#tag) - The tag checked out from the repository. Returns a string.
- [`destination`](#destination) - The destination where the repository is stored.

---
<a id="auth"></a>
The `auth` block supports:
- [`username`](#username) - The username to be used. If password is specified, and if the username is empty, it falls back to `oauth2`
- [`password`](#password) - The password to be used for connecting to the private repository.




10 changes: 9 additions & 1 deletion docs/src/configuration/stage.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ stage "build" {
{{#include ../../../examples/docker/togomak.hcl}}
```


## Stage with daemons, with lifecycle rules
```hcl
{{#include ../../../examples/daemon-until/togomak.hcl}}
```

## Arguments Reference
* [`name`](#name) - The name of the stage
Expand Down Expand Up @@ -127,3 +130,8 @@ The `container` block supports:
The `daemon` block supports:
* [`enabled`](#enabled) - Whether the stage should be run as a daemon, defaults to `false`
* [`timeout`](#timeout) - Time to wait until the stage is terminated, in seconds. Defaults to 0 (no timeout).
* [`lifecycle`](#lifecycle) - Set of rules which decide if the daemon needs to be terminated, or not. Structure [documented below](#lifecycle)
---
<a id="lifecycle"></a>

* [`stop_when_complete`] - Array of stages. `togomak` waits for all the stages mentioned in the `stop_when_complete` argument, before sending `SIGTERM` to the daemon process
38 changes: 31 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ module github.com/srevinsaju/togomak/v1
go 1.20

require (
code.gitea.io/gitea v1.19.3
github.com/AlecAivazis/survey/v2 v2.3.6
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2
github.com/alessio/shellescape v1.4.1
github.com/bcicen/jstream v1.0.1
github.com/bmatcuk/doublestar v1.1.5
github.com/bmatcuk/doublestar/v4 v4.6.0
github.com/creack/pty v1.1.18
github.com/docker/docker v24.0.2+incompatible
github.com/docker/go-connections v0.4.0
github.com/fatih/color v1.15.0
github.com/go-git/go-billy/v5 v5.4.1
github.com/go-git/go-git/v5 v5.7.0
github.com/google/uuid v1.3.0
github.com/hashicorp/go-envparse v0.1.0
github.com/hashicorp/go-uuid v1.0.3
Expand All @@ -35,47 +34,72 @@ require (
)

require (
gitea.com/go-chi/cache v0.2.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/djherbis/buffer v1.2.0 // indirect
github.com/djherbis/nio/v3 v3.0.1 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/go-enry/go-enry/v2 v2.8.3 // indirect
github.com/go-enry/go-oniguruma v1.2.1 // indirect
github.com/go-fed/httpsig v1.1.1-0.20201223112313-55836744818e // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.4.1 // indirect
github.com/go-git/go-git/v5 v5.7.0 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.3 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/pprof v0.0.0-20230111200839-76d1ae5aea2b // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/golang-lru v0.6.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-sqlite3 v1.14.16 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc3 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/redis/go-redis/v9 v9.0.3 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/skeema/knownhosts v1.1.1 // indirect
github.com/syndtr/goleveldb v1.0.0 // indirect
github.com/unknwon/com v1.0.1 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yuin/goldmark v1.5.3 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.7.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.4.0 // indirect
Expand Down
Loading

0 comments on commit 5cd71f8

Please sign in to comment.