module "myapp" {
dependency "exec" "helmfile" {
command = "go"
args = ["run", "main.go"]
version = "> 0.94.0"
}
dependency "timestamp_git" "configrepo" {
# dep.configrepo.version looks like "20200225.1230.40-<commit id>"
# and it is updated only when the directory `./apps` is updated after "2020.2.25 12:30:40 UTC"
source = "github.com/mumoshu/configrepo/master/apps"
}
dependency "dockerimage" "guestbook" {
source = "mumoshu/guestbook"
}
dependency "dockerimage" "api" {
source = "mumoshu/api"
}
file "argocd/apps.yaml" {
source = "apps.yaml.tpl"
args = {
commit = split(dep.configrepo.version, "-")[1]
}
}
directory "helmfiles/guestbook" {
source = "./helmfile-base"
# some additional files and helmfile snippets...
}
directory "apps/guestbook" {
source = "./helmfiles/guestbook"
exec {
command = "bash"
args = list("-c", "helmfile -f ${source} template --state-values-set image.tag=${dep.guestbook.version} > ${dir}/all.yaml")
}
}
directory "helmfiles/api" {
source = "./helmfile-base"
# some additional files and helmfile snippets...
}
directory "apps/api" {
source = "./helmfiles/api"
exec {
command = "bash"
args = list("-c", "helmfile -f ${source} template --state-values-set image.tag=${dep.api.version} > ${dir}/all.yaml")
}
}
}
Last active
February 25, 2020 01:45
-
-
Save mumoshu/3078a9fcec03df90c2c0a7ef80debc10 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
apiVersion: argoproj.io/v1alpha1 | |
kind: Application | |
metadata: | |
name: apps | |
namespace: kube-system | |
spec: | |
project: default | |
source: | |
repoURL: https://github.com/mumoshu/configrepo.git | |
targetRevision: HEAD | |
path: argocd | |
destination: | |
server: https://kubernetes.default.svc | |
namespace: kube-system |
This file contains hidden or 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
apiVersion: argoproj.io/v1alpha1 | |
kind: Application | |
metadata: | |
name: guestbook | |
namespace: argocd | |
spec: | |
project: default | |
source: | |
repoURL: https://github.com/mumoshu/configrepo.git | |
targetRevision: {{.commit}} | |
path: apps/guestbook | |
destination: | |
server: https://kubernetes.default.svc | |
namespace: guestbook | |
--- | |
apiVersion: argoproj.io/v1alpha1 | |
kind: Application | |
metadata: | |
name: api | |
namespace: argocd | |
spec: | |
project: default | |
source: | |
repoURL: https://github.com/mumoshu/configrepo.git | |
targetRevision: {{.commit}} | |
path: apps/api | |
destination: | |
server: https://kubernetes.default.svc | |
namespace: api |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment