Skip to content

Commit

Permalink
Merge pull request #15 from dung13890/develop
Browse files Browse the repository at this point in the history
refs update feature
  • Loading branch information
dung13890 authored Feb 23, 2021
2 parents 3e7b69e + 87fedc4 commit bb0fea8
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 33 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

*Note: [init](docs/images/init.gif?raw=true) | [ping](docs/images/ping.gif?raw=true)*

## Features
- Deployment from local into remote
- Deployment on remote
- Run command for multiple remote
- Rsync multiple cluster
- Notify to chatwork, slack
- UI for deployment

## Run with docker for development
```sh
Expand Down
5 changes: 2 additions & 3 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"errors"
"fmt"
"github.com/AlecAivazis/survey/v2"
"github.com/dung13890/deploy-tool/config"
"github.com/fatih/color"
"github.com/urfave/cli/v2"
"log"
Expand Down Expand Up @@ -92,11 +91,11 @@ func (a *answers) createFile(filename string) (err error) {
return
}
// Parse template to template yml
t, err := template.New("index").Parse(config.SourceYaml)
t, err := template.ParseFiles(filepath.Join(dir, "templates", "config.tmpl"))
if err != nil {
return
}
t.Execute(f, a)
t.ExecuteTemplate(f, "config", a)

return nil
}
30 changes: 0 additions & 30 deletions config/yaml.go

This file was deleted.

28 changes: 28 additions & 0 deletions templates/config.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{define "config"}}server:
address: "{{ .Ip }}"
user: "ec2-user"
port: 22
dir: "/data/sites"
project: "{{ .Project }}"
repository:
url: "{{ .Repo }}"
branch: "master"
# tag: "1.0.2"
shared:
folders:
- "vendor"
- "node_modules"
files:
- ".env"
tasks:
- "echo 'Hello!!'"
cluster:
hosts:
# - "127.0.0.1"
rsync:
excludes:
- ".env"
- "*.log"
cmds:
- "uname -a"
{{end}}

0 comments on commit bb0fea8

Please sign in to comment.