Commit f270a44 1 parent 7e44f2b commit f270a44 Copy full SHA for f270a44
File tree 1 file changed +8
-2
lines changed
website/content/docs/job-specification
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -117,16 +117,22 @@ artifact {
117
117
}
118
118
```
119
119
120
- To download from private repo, sshkey needs to be set. The key must be
120
+ To download from a private repo, sshkey needs to be set. The key must be
121
121
base64-encoded string. On Linux, you can run ` base64 -w0 <file> ` to encode the
122
122
file. Or use [ HCL2] ( https://www.nomadproject.io/docs/job-specification/hcl2 )
123
123
expressions to read and encode the key from a file on your machine:
124
124
125
125
``` hcl
126
126
artifact {
127
- source = "[email protected] :example/nomad-examples"
127
+ # The git:: prefix forces go-getter's protocol detection to use the git ssh
128
+ # protocol. It can also automatically detect the protocol from the domain of
129
+ # some git hosting providers (such as GitHub) without the prefix.
130
+ source = "git::[email protected] :example/nomad-examples"
128
131
destination = "local/repo"
129
132
options {
133
+ # Make sure that the Nomad user's known hosts file is populated:
134
+ # ssh-keyscan github.com | sudo tee -a /root/.ssh/known_hosts
135
+ # https://github.com/hashicorp/go-getter/issues/55
130
136
sshkey = "${base64encode(file(pathexpand("~/.ssh/id_rsa")))}"
131
137
}
132
138
}
You can’t perform that action at this time.
0 commit comments