parent
e737b64a07
commit
0f448136c9
|
@ -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.
|
||||||
|
```
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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=
|
|
@ -3,13 +3,36 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
|
||||||
|
"github.com/go-ini/ini"
|
||||||
"log"
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
type Config struct {
|
||||||
cmd, err := exec.Command( "/bin/bash", "cmd.sh").Output()
|
SSH_Key string
|
||||||
if err != nil {
|
Git_url string
|
||||||
log.Fatal(err)
|
Deploy_dir string
|
||||||
}
|
Container_name string
|
||||||
fmt.Printf("%s\n", cmd)
|
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
|
Loading…
Reference in New Issue