Skip to content

Commit

Permalink
generate ssh target from release hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
maximecolin committed Apr 21, 2021
1 parent 22c2b18 commit 7902319
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions elao.app/.manala/Makefile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,22 @@ deploy{{ include "release_target" $release }}:

{{- end -}}

#######
# SSH #
#######

{{- range $release := .Vars.releases }}
{{- if hasKey $release "deploy_hosts" }}
{{- range $index, $host := $release.deploy_hosts }}
{{- $length := len $release.deploy_hosts }}
## Ssh to {{ if hasKey $release "app" }}{{ $release.app }} {{ end }}{{ $release.mode }}{{ if gt $length 1 }} {{ (add $index 1) | printf "%02d" }}{{ end }} server
ssh{{ if hasKey $release "app" }}-{{ $release.app }}{{ end }}@{{ $release.mode }}{{ if gt $length 1 }}-{{ (add $index 1) | printf "%02d" }}{{ end }}: SHELL := $(or $(DOCKER_SHELL),$(SHELL))
ssh{{ if hasKey $release "app" }}-{{ $release.app }}{{ end }}@{{ $release.mode }}{{ if gt $length 1 }}-{{ (add $index 1) | printf "%02d" }}{{ end }}:
ssh {{ if hasKey $host "ssh_user" }}{{ $host.ssh_user }}@{{ end }}{{ $host.ssh_host }}
{{- end }}
{{- end -}}
{{- end }}

###########
# Project #
###########
Expand Down

0 comments on commit 7902319

Please sign in to comment.