Skip to content

Commit

Permalink
make sure we can upload artifacts.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Jun 17, 2021
1 parent ef3690a commit 7b57485
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
11 changes: 7 additions & 4 deletions cmd/publishr/publishr.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ func main() {
if c.IsSet("remote_branch") {
configuration.Set(config.PACKAGR_SCM_REMOTE_BRANCH, c.String("remote_branch"))
}
if c.IsSet("upload_artifact") {
configuration.Set(config.PACKAGR_SCM_RELEASE_ASSETS, c.StringSlice("upload_artifact"))
}

fmt.Println("package type:", configuration.GetString(config.PACKAGR_PACKAGE_TYPE))
fmt.Println("scm:", configuration.GetString(config.PACKAGR_SCM))
Expand Down Expand Up @@ -103,10 +106,10 @@ func main() {
Name: "dry_run",
Usage: "When dry run is enabled, no data is written to file system",
},
//&cli.StringSliceFlag{
// Name: "upload_artifact",
// Usage: "Path to a release artifact"
//},
&cli.StringSliceFlag{
Name: "upload_artifact",
Usage: "Path to a release artifact(s). Can be called multiple times. Use [FILE_PATH]:[UPLOADED_FILE_NAME] syntax to override destination file name",
},
},
},
},
Expand Down
1 change: 1 addition & 0 deletions pkg/config/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const PACKAGR_PACKAGE_TYPE = "package_type"
const PACKAGR_SCM = "scm"
const PACKAGR_SCM_LOCAL_BRANCH = "scm_local_branch"
const PACKAGR_SCM_REMOTE_BRANCH = "scm_remote_branch"
const PACKAGR_SCM_RELEASE_ASSETS = "scm_release_assets"
const PACKAGR_ENGINE_REPO_CONFIG_PATH = "engine_repo_config_path"
const PACKAGR_VERSION_METADATA_PATH = "version_metadata_path"
const PACKAGR_GENERIC_VERSION_TEMPLATE = "generic_version_template"
Expand Down
10 changes: 0 additions & 10 deletions pkg/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,6 @@ func (p *Pipeline) ParseRepoConfig() error {
log.Println("No repo capsule.yml file found, using existing config.")
}

if p.Config.IsSet("scm_release_assets") {
//unmarshall config data.
parsedAssets := new([]pipeline.ScmReleaseAsset)
if err := p.Config.UnmarshalKey("scm_release_assets", parsedAssets); err != nil {
return err
}

//append the parsed Assets to the current ReleaseAssets storage (incase assets were defined in system yml)
p.Data.ReleaseAssets = append(p.Data.ReleaseAssets, (*parsedAssets)...)
}
return nil
}

Expand Down

0 comments on commit 7b57485

Please sign in to comment.