Commit 6fcc6789 authored by Matt Pryor's avatar Matt Pryor
Browse files

Replace Python nastiness with gomplate

parent 6b993abf
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -25,9 +25,9 @@ ARG COMPOSE_VERSION=1.22.0
RUN curl -fsSL https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose && \
    chmod +x /usr/local/bin/docker-compose

# Install jq and PyYAML
# Install jq
RUN apt-get update && \
    apt-get install -y jq python-yaml && \
    apt-get install -y jq && \
    rm -rf /var/lib/apt/lists/*

# Copy the gomplate binary from esgf-configure
+2 −2
Original line number Diff line number Diff line
@@ -22,10 +22,10 @@ function indent {
}

function yaml2json {
    python -c 'import sys, yaml, json; print json.dumps(yaml.load(sys.stdin))'
    gomplate -i '{{ ds "input" | toJSON }}' -d input=stdin:?type=application/yaml
}
function json2yaml {
    python -c 'import sys, yaml, json; print yaml.safe_dump(json.load(sys.stdin), default_style="|", default_flow_style=False)'
    gomplate -i '{{ ds "input" | toYAML }}' -d input=stdin:?type=application/json
}
function merge_yaml {
    # Convert the source files to JSON