in shells/abstract.go [446:491]
func (b *AbstractShell) uploadArtifacts(w ShellWriter, info common.ShellScriptInfo) {
if info.Build.Runner.URL == "" {
return
}
for _, artifacts := range info.Build.Artifacts {
args := []string{
"artifacts-uploader",
"--url",
info.Build.Runner.URL,
"--token",
info.Build.Token,
"--id",
strconv.Itoa(info.Build.ID),
}
// Create list of files to archive
archiverArgs := []string{}
for _, path := range artifacts.Paths {
archiverArgs = append(archiverArgs, "--path", path)
}
if artifacts.Untracked {
archiverArgs = append(archiverArgs, "--untracked")
}
if len(archiverArgs) < 1 {
// Skip creating archive
continue
}
args = append(args, archiverArgs...)
if artifacts.Name != "" {
args = append(args, "--name", artifacts.Name)
}
if artifacts.ExpireIn != "" {
args = append(args, "--expire-in", artifacts.ExpireIn)
}
b.guardRunnerCommand(w, info.RunnerCommand, "Uploading artifacts", func() {
w.Notice("Uploading artifacts...")
w.Command(info.RunnerCommand, args...)
})
}
}