# Publication ```job: build_name: me strict: true recipe: git_ref: testing-devel git_url: https://github.com/coreos/fedora-coreos-config stages: - id: base description: build build_artifacts: - base - aws - gcp - id: testing blocking: false own_pod: true requires_artifacts: - base - metal4k - metal - installer concurrent: true commands: - kola basic.... - kola... - kola... - id: publish concurrent: true require_artifacts: - aws // <should be implied by publish> - gcp publish_artifacts: - cloud: aws bucket: myBucketOfTears region: ... extraArgs: "--force --omg-why-me" ``` ``` type cloudPublicationSpec struct { cloud string "yaml:'cloud',envVAr:'COSA_CLOUD_NAME'" // sets to "" if not defined bucket string "yaml:'bucket,omitEmpty',envVar:'COSA_BUCKET'" // sets to nil if not defined extraArgs string "yaml:'extraArgs',cliArgs" } ``` Logic for `cloudPublicationSpec`: - look for tag of cloud to get name -> `cosa ore-wrapper --target $COSA_CLOUD_NAME....` check against https://github.com/coreos/coreos-assembler/blob/master/gangplank/cosa/build.go#L148-L156 - if no build for base_artifact, then it needs to _imply_ requires - look for envVars and _set them (i.e. bucket becomes COSA_BUCKET) - check for cliArgs and then added them to the command - In the example, it would be rended: `cosa ore-warpper --target aws --force --omg-why-me` with envVars of `COSA_BUCKET=myBucketOfTears Logic: * publish_artifacts should trigger publication calls to `cosa ?` * the secret mapping should be extended to support the publication * the stage defintion should defined. `gangplank/spec/stages.go` add a helper for `getPublicationCommands()` which would render the `cosa ....` * the `cmd-buildextend-*` should be extended to support envVars for the publication. I *think* the way to do the envVars is to `cmd-ore-wrapper` and _ADD_ envVars to the command line arguments. `cmd-ore-wrapper`: ``` parser.add_argument("--config", "--config-file", default=os.environ.get("<CLOUD>_CONFIG_FILE", ""), help="ore configuration")