From f1559206af9e7303b47684fde059d67fd6bd7f63 Mon Sep 17 00:00:00 2001 From: Drew Short Date: Mon, 10 Feb 2020 12:12:07 -0600 Subject: [PATCH] Initial commit --- Dockerfile | 24 ++++++++++++++++++++++++ README.md | 5 +++++ pipeline.yml | 31 +++++++++++++++++++++++++++++++ tag | 1 + upload_pipeline.sh | 11 +++++++++++ 5 files changed, 72 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 pipeline.yml create mode 100644 tag create mode 100644 upload_pipeline.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9d83e7a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM golang:1.13-buster as build +ARG YTT_VERSION=master +RUN echo building ytt $YTT_VERSION \ + && git clone \ + --branch "${YTT_VERSION}" \ + --single-branch \ + --depth 1 \ + https://github.com/k14s/ytt \ + ./src/github.com/k14s/ytt +WORKDIR /go/src/github.com/k14s/ytt +RUN CGO_ENABLED=0 go build -o ytt ./cmd/ytt/... + +FROM debian:buster-slim +LABEL maintainer="Drew Short " +COPY --from=build /go/src/github.com/k14s/ytt/ytt /usr/bin/ytt +RUN apt-get -y update \ + && apt-get -y --no-install-recommends install \ + bash \ + bsdmainutils \ + util-linux \ + && rm -Rf /var/lib/apt/lists/* +WORKDIR /project +ENTRYPOINT ["/usr/bin/ytt"] +CMD ["-h"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..0e8fb62 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# ytt + +[![Concourse](https://concourse.nulloctet.com/api/v1/teams/docker/pipelines/ytt/jobs/build-image/badge)](https://concourse.nulloctet.com/teams/docker/pipelines/ytt) + +Docker image build for using ytt to work with yaml templates files diff --git a/pipeline.yml b/pipeline.yml new file mode 100644 index 0000000..7e30fa8 --- /dev/null +++ b/pipeline.yml @@ -0,0 +1,31 @@ +--- +resources: + - name: git-resource + type: git + icon: git + source: + uri: https://git.nulloctet.com/docker/ytt.git + ignore_paths: + - upload_pipeline.sh + - README.md + - name: git-resource-image + type: docker-image + icon: docker + source: + repository: ((nexus_docker_write.host))/sothr/ytt + username: ((nexus_docker_write.username)) + password: ((nexus_docker_write.password)) + +jobs: + - name: build-image + plan: + - get: git-resource + trigger: true + - put: git-resource-image + params: + build: git-resource + build_args: + YTT_VERSION: v0.25.0 + tag_file: git-resource/tag + tag_as_latest: true + get_params: {skip_download: true} diff --git a/tag b/tag new file mode 100644 index 0000000..d21d277 --- /dev/null +++ b/tag @@ -0,0 +1 @@ +0.25.0 diff --git a/upload_pipeline.sh b/upload_pipeline.sh new file mode 100644 index 0000000..7dcfee7 --- /dev/null +++ b/upload_pipeline.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +TEAM=docker +PIPELINE=ytt + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +pushd "${DIR}" || true + +fly -t ${TEAM} set-pipeline --pipeline ${PIPELINE} --config pipeline.yml + +popd || true