Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Add ability for render steps to specify specific assets #855

Merged
merged 4 commits into from
Mar 11, 2019

Conversation

dexhorthy
Copy link
Member

What I Did

Add an assets.v1 field to lifecycle.v1.render. If set, the lifecycle step will render the assets on the step instead of the global assets.v1 at the root of the spec.

This can be used to break up rendering into several steps. This has a lot of use cases, the one I'm thinking of is

  • run a render to pull a helm chart repo with a github asset
  • then execute a helmValues step to store some custom values
  • run a second render with a helm asset using local_path and
    values_from

Essentially I want to be able to have something like the ship init <chart> workflow for any ship.yaml application.

How I Did it

  • Add fields to schema and types
  • Add a check in lifecycle/render for assets on lifecycle step. If not
    present, we use the old behavior of rendering all the assets at the top
    level
  • write a few integration tests

Still TODO

  • still need to update hack/docs and replicated-lint to reflect the new schema

Other random stuff

  • removed some misleading assertions on one of our unittests, they
    weren't testing anything, but seemed to imply that they were checking
    render ouputs

How to verify it

ship init ~/go/src/github.com/replicatedhq/ship/integration/base/direct-render/input/.ship/ship.yml

Description for the Changelog

Add an assets.v1 field to lifecycle.v1.render. If set, the lifecycle step will render the assets on the render step instead of the global assets.v1 at the root of the spec.

https://img2.cgtrader.com/items/889785/6c5c722eb1/large/live-fish-carrier-vessel-ship-render-ready-3d-model-max-obj-fbx-stl-mtl.jpg

What I Did
------------
Add an `assets.v1` field to `lifecycle.v1.render`. If set, the lifecycle step will render the assets on the step instead of the global `assets.v1` at the root of the spec.

This can be used to break up rendering into several steps. This has a lot of use cases, the one I'm thinking of is

- run a render to pull a helm chart repo with a `github` asset
- then execute a helmValues step to store some custom values
- run a second render with a `helm` asset using `local_path` and
`values_from`

Essentially I want to be able to have something like the `ship init <chart>` workflow for any `ship.yaml` application.

How I Did it
------------

- Add fields to schema and types
- Add a check in lifecycle/render for assets on lifecycle step. If not
present, we use the old behavior of rendering all the assets at the top
level
- write a few integration tests

*Still TODO*

- still need to update hack/docs and replicated-lint to reflect the new schema

*Other random stuff*
- removed some misleading assertions on one of our unittests, they
weren't testing anything, but seemed to imply that they were checking
render ouputs

How to verify it
------------

ship init ~/go/src/github.com/replicatedhq/ship/integration/base/direct-render/input/.ship/ship.yml

Description for the Changelog
------------

Add an `assets.v1` field to `lifecycle.v1.render`. If set, the lifecycle step will render the assets on the render step instead of the global `assets.v1` at the root of the spec.

![https://img2.cgtrader.com/items/889785/6c5c722eb1/large/live-fish-carrier-vessel-ship-render-ready-3d-model-max-obj-fbx-stl-mtl.jpg](https://img2.cgtrader.com/items/889785/6c5c722eb1/large/live-fish-carrier-vessel-ship-render-ready-3d-model-max-obj-fbx-stl-mtl.jpg)
@dexhorthy dexhorthy requested a review from Rob0h March 8, 2019 23:37
@dexhorthy dexhorthy merged commit 268ee8c into replicatedhq:master Mar 11, 2019
@dexhorthy dexhorthy deleted the specific-render branch March 13, 2019 14:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants