# Refactor manifest reference https://github.com/getporter/porter/issues/1335 https://github.com/getporter/porter/issues/1334 ``` name: porter-hello version: v0.1.0 ``` porter build && porter publish --registry carolynvs/ --- ``` name: porter-hello # no version ``` porter build --version v0.1.1 - write the version to bundle.json - write a temp manifest with version and save that into the bundle - .cnab/app/porter.yaml (runtime manifest uses this porter.yaml) - always marshall the final manifest to the .cnab dir - doesn't change local file system - manifest stamp off of local unedited porter.yaml (because we use it to detect changes) - long term we hash all files included by docker build - figure out long term hash plan in case of breaking changes - remove --reference and --registry so that the manifest doesn't change depending on where you publish, not in the manifest at all by 1.0, deprecated until then just like tag. what is the tag of the invocation image? - always tag it the same thing - porter.sh/bundlename-installer:VERSION - invocation image is in the bundle.json ``` porter publish ``` -- not ideal: tag a build is triggered because we edit p.Manifest.Image - docker tag STATIC_TAG FINAL_TAG of invocation image - write a relocation mapping file and publish it - do not edit and rebuild bundle.json to avoid re-building - reads from .cnab/app/porter.yaml - make sure auto build happens when it's missing - only have --reference and --registry, not name or version (because that happens at build) ## Task Breakdown 🚨 Ask Mike Larah to review changes to the CI workflow with build and publish. -> https://github.com/getporter/porter/issues/694#issuecomment-721276220 - temp manifest that we edit created during build, used during publish -> https://github.com/getporter/porter/issues/1352 - this is copied into the invocation image - PRO: immutable bundle.json and porter.yaml in invocation image - Add name and version editable at build -> https://github.com/getporter/porter/issues/1334 - when --version/name is set, make sure the final value is in the temp manifest - Optional version in manifest -> TODO - remove validation - Add reference/registry editable at publish -> https://github.com/getporter/porter/issues/1335 - static invocation image _name_ during build -> TODO - tweak relocation mapping maybe? - avoid triggering rebuild during publish -> TODO - use relocation mapping during publish using --reference/registry to avoid rebuild - manifest stamp built on user porter.yaml (not generated one) - Consider only having registry/reference settable at publish. Not in the manifest at all. -> TODO (probably require PEP) - PRO: less confusion, consistent publish --reference, never a bare porter publish --- ``` name: SampleApp version: 0.1.0 description: "Sample app cnab bundle" install: - helm: chart: version: "{{ bundle.metadata.version }}" | .name, .description, etc ``` https://github.com/getporter/porter/issues/814 --bug? BUSTED! 2. publish to alt location --tag 3. archive from alt location ? what is the invocation image in bundle.json? pull default loc invocation image archive it into tgz bundle.json still references default location relo file default invo image path : airgap side invo image path