Skip to content

SAAS-4839 #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 37 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
ARG HELM_VERSION
ARG S3_PLUGIN_VERSION
ARG GCS_PLUGIN_VERSION
ARG PUSH_PLUGIN_VERSION
ARG KUBE_VERSION="v1.14.3"
ARG ALPINE_VERSION=3.11
ARG PYTHON_VERSION=3.8

# SETUP
FROM golang:latest as setup
ARG HELM_VERSION
ARG S3_PLUGIN_VERSION
ARG GCS_PLUGIN_VERSION
ARG PUSH_PLUGIN_VERSION
RUN echo "HELM_VERSION is set to: ${HELM_VERSION}" && mkdir /temp
RUN curl -L "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" -o helm.tar.gz \
ENV HELM_VERSION ${HELM_VERSION}
ARG KUBE_VERSION
RUN echo "HELM_VERSION is set to: ${HELM_VERSION}"
RUN apt update && apt install -y bash \
&& curl -L "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" -o helm.tar.gz \
&& tar -zxvf helm.tar.gz \
&& mv ./linux-amd64/helm /usr/local/bin/helm \
&& bash -c 'if [[ "${HELM_VERSION}" == 2* ]]; then helm init --client-only; else echo "using helm3, no need to initialize helm"; fi' \
&& helm plugin install https://github.com/hypnoglow/helm-s3.git --version=${S3_PLUGIN_VERSION} \
&& helm plugin install https://github.com/nouney/helm-gcs.git --version=${GCS_PLUGIN_VERSION} \
&& helm plugin install https://github.com/chartmuseum/helm-push.git --version=${PUSH_PLUGIN_VERSION}
&& curl -L https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl
RUN bash -c 'if [[ "${HELM_VERSION}" == 2* ]]; then helm init --client-only; else echo "using helm3, no need to initialize helm"; fi' \
&& helm plugin install https://github.com/hypnoglow/helm-s3.git \
&& helm plugin install https://github.com/nouney/helm-gcs.git \
&& helm plugin install https://github.com/chartmuseum/helm-push.git

# Run acceptance tests
COPY Makefile Makefile
Expand All @@ -26,17 +29,30 @@ RUN apt-get update \
&& apt-get install -y python3-venv \
&& make acceptance

FROM codefresh/kube-helm:${HELM_VERSION}

# MAIN
FROM python:${PYTHON_VERSION}-alpine${ALPINE_VERSION}

WORKDIR /config

ARG HELM_VERSION
COPY --from=setup /temp /root/.helm/* /root/.helm/
COPY bin/* /opt/bin/
RUN chmod +x /opt/bin/*
COPY lib/* /opt/lib/
ENV HELM_VERSION ${HELM_VERSION}

# Install Python3
RUN apk add --no-cache python3 \
RUN echo "HELM_VERSION is set to: ${HELM_VERSION}"

RUN apk add --update ca-certificates && update-ca-certificates \
&& apk add --update --no-cache curl bash jq make git openssl \
&& pip install yq \
&& rm /var/cache/apk/* \
&& rm -rf /tmp/* \
&& rm -rf /root/.cache

ENV HELM_VERSION ${HELM_VERSION}
COPY --from=setup /usr/local/bin/helm /usr/local/bin/helm
COPY --from=setup /usr/local/bin/kubectl /usr/local/bin/kubectl

RUN bash -c 'if [[ "${HELM_VERSION}" == 2* ]]; then helm init --client-only; else echo "using helm3, no need to initialize helm"; fi'

COPY bin/* /opt/bin/
COPY lib/* /opt/lib/

ENTRYPOINT ["/opt/bin/release_chart"]
ENTRYPOINT ["/opt/bin/release_chart"]