Enabled Config

Added Readme
This commit is contained in:
konrad 2017-04-28 21:19:58 +02:00 committed by konrad
parent e737b64a07
commit 0f448136c9
9 changed files with 52 additions and 6 deletions

16
Readme.md Normal file
View File

@ -0,0 +1,16 @@
# Simple Git Deploy
# Troubleshooting
### Not Cloning - the script runs pretty fast but wont clone
Check the permissions of your keyfile. They should be 600, otherwise the ssh-agent will ignore the keyfile and won't clone.
```
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0664 for '/home/konrad/Schreibtisch/life-wob/life-deploy' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
```

BIN
bin/goimports Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,5 @@
ssh_key=/home/konrad/Schreibtisch/life-wob/life-deploy
git_url=ssh://git@git.mowie.cc:9022/Websites/Life-Homepage.git
deploy_dir=/home/konrad/Schreibtisch/life-wob/html
container_name=
secret=

View File

@ -3,13 +3,36 @@ package main
import (
"fmt"
"os/exec"
"github.com/go-ini/ini"
"log"
)
func main() {
cmd, err := exec.Command( "/bin/bash", "cmd.sh").Output()
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", cmd)
type Config struct {
SSH_Key string
Git_url string
Deploy_dir string
Container_name string
Secret string
}
func main() {
//Init Config
cfg, _ := ini.Load("config.ini")
var Conf Config
Conf.SSH_Key = cfg.Section("").Key("ssh_key").String()
Conf.Deploy_dir = cfg.Section("").Key("deploy_dir").String()
Conf.Git_url = cfg.Section("").Key("git_url").String()
Conf.Container_name = cfg.Section("").Key("container_name").String()
Conf.Secret = cfg.Section("").Key("secret").String()
if Conf.Git_url != "" && Conf.Deploy_dir != "" && Conf.SSH_Key != "" {
cmd, err := exec.Command("/bin/bash", "deploy.sh", "-k", Conf.SSH_Key, "-g", Conf.Git_url, "-d", Conf.Deploy_dir, "-c", Conf.Container_name).Output()
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", cmd)
} else {
fmt.Println("You must provide at least a Git-Url, Deploy-Dir and SSH-Key!")
}
}

@ -0,0 +1 @@
Subproject commit e7fea39b01aea8d5671f6858f0532f56e8bff3a5

@ -0,0 +1 @@
Subproject commit 2382e3994d48b1d22acc2c86bcad0a2aff028e32