Skip to content

Instantly share code, notes, and snippets.

@michaellihs michaellihs/jsonnet.md
Last active May 24, 2019

Embed
What would you like to do?
jsonnet

jsonnet

CLI usage

  • Output result in YAML

    jsonnet ci/pipeline.jsonnet
  • Using external file as parameters

    jsonnet --ext-code-file "config=ci/config/de1/settings.libsonnet" ci/pipeline.jsonnet

    where ci/config/de1/settings.libsonnet is the 'parameter file' and ci/pipeline.jsonnet is what needs to be parametrized.

    Within the parametrized .jsonnet:

    local config = std.extVar('config');
    
    {
      vcenter_password: config.vcenter_password
    }
    

User jsonnet in Docker Image

FROM robotgraves/flycli AS builder

RUN apt-get install -y build-essential git

WORKDIR /opt

RUN git clone https://github.com/google/jsonnet.git jsonnet
RUN cd jsonnet && make


FROM robotgraves/flycli

COPY --from=builder /opt/jsonnet/jsonnet /usr/local/bin

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.