@ -2,11 +2,11 @@ package main
import (
import (
"fmt"
"fmt"
"github.com/Sirupsen/logrus"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sts"
"github.com/aws/aws-sdk-go/service/sts"
"github.com/Sirupsen/logrus"
"io/ioutil"
"io/ioutil"
"os"
"os"
"os/exec"
"os/exec"
@ -44,6 +44,9 @@ func (p Plugin) Exec() error {
var commands [ ] * exec . Cmd
var commands [ ] * exec . Cmd
remote := p . Config . Remote
remote := p . Config . Remote
if len ( p . Config . Secrets ) != 0 {
exportSecrets ( p . Config . Secrets )
}
if p . Config . Cacert != "" {
if p . Config . Cacert != "" {
commands = append ( commands , installCaCert ( p . Config . Cacert ) )
commands = append ( commands , installCaCert ( p . Config . Cacert ) )
}
}
@ -93,6 +96,12 @@ func installCaCert(cacert string) *exec.Cmd {
)
)
}
}
func exportSecrets ( secrets map [ string ] string ) {
for k , v := range secrets {
os . Setenv ( fmt . Sprintf ( "%s" , k ) , fmt . Sprintf ( "%s" , os . Getenv ( v ) ) )
}
}
func deleteCache ( ) * exec . Cmd {
func deleteCache ( ) * exec . Cmd {
return exec . Command (
return exec . Command (
"rm" ,
"rm" ,