generated from coderefinery/word-count
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to access git over ssh (#259)
* Add ability to access git over ssh Signed-off-by: djach7 <djachimo@redhat.com> * testing permissions and file placement Signed-off-by: Ryan Cook <rcook@redhat.com> Signed-off-by: djach7 <djachimo@redhat.com> Signed-off-by: Ryan Cook <rcook@redhat.com> Co-authored-by: Ryan Cook <rcook@redhat.com>
- Loading branch information
1 parent
5d48e21
commit dffb843
Showing
8 changed files
with
186 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
gitAuth: | ||
ssh: true | ||
sshKeyFile: id_rsa | ||
targetConfigs: | ||
- url: git@github.com:containers/fetchit | ||
filetransfer: | ||
- name: ft-ex | ||
targetPath: examples/filetransfer | ||
destinationDirectory: /tmp | ||
schedule: "*/1 * * * *" | ||
branch: main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package engine | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
var defaultSSHKey = filepath.Join("/opt", "mount", ".ssh", "id_rsa") | ||
|
||
// Basic type needed for ssh authentication | ||
type GitAuth struct { | ||
SSH bool `mapstructure:"ssh"` | ||
SSHKeyFile string `mapstructure:"sshKeyFile"` | ||
Username string `mapstructure:"username"` | ||
Password string `mapstructure:"password"` | ||
PAT string `mapstructure:"pat"` | ||
} | ||
|
||
// Checks to see if private key exists on given path | ||
func checkForPrivateKey(path string) error { | ||
if _, err := os.Stat(path); err != nil { | ||
return err | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters