Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 11 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,24 @@ jobs:
pip3 install awscli==1.16.292
$(aws ecr get-login --no-include-email --region ${AWS_REGION} --registry-ids ${AWS_ACCOUNT_ID})
- run:
name: Build and push image
name: Build and push main image
command: |
export SHORT_GIT_SHA=$(echo ${CIRCLE_SHA1} | cut -c -7)
docker build \
-t ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/kubeapply:${SHORT_GIT_SHA} \
--build-arg VERSION_REF=${SHORT_GIT_SHA} \
.
docker push ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/kubeapply:${SHORT_GIT_SHA}
- run:
name: Build and push lambda image
command: |
export SHORT_GIT_SHA=$(echo ${CIRCLE_SHA1} | cut -c -7)
docker build \
-f Dockerfile.lambda \
-t ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/kubeapply-lambda:${SHORT_GIT_SHA} \
--build-arg VERSION_REF=${SHORT_GIT_SHA} \
.
docker push ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/kubeapply-lambda:${SHORT_GIT_SHA}

workflows:
version: 2
Expand Down
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Dockerfile
Dockerfile.lambda
build
deps
*zip
Expand Down
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ ENV SRC github.com/segmentio/kubeapply

RUN apt-get update && apt-get install --yes \
curl \
libbtrfs-dev \
libdevmapper-dev \
wget

COPY . /go/src/${SRC}
Expand All @@ -29,7 +27,6 @@ FROM ubuntu:18.04
RUN apt-get update && apt-get install --yes \
curl \
git \
libdevmapper-dev \
python3 \
python3-pip

Expand Down
41 changes: 41 additions & 0 deletions Dockerfile.lambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Fetch or build all required binaries
FROM golang:1.14 as builder

ARG VERSION_REF
RUN test -n "${VERSION_REF}"

ENV SRC github.com/segmentio/kubeapply

RUN apt-get update && apt-get install --yes \
curl \
wget

COPY . /go/src/${SRC}
RUN cd /usr/local/bin && /go/src/${SRC}/scripts/pull-deps.sh

WORKDIR /go/src/${SRC}

ENV CGO_ENABLED=1
ENV GO111MODULE=on

RUN make kubeapply VERSION_REF=${VERSION_REF} && \
cp build/kubeapply /usr/local/bin
RUN make kubeapply-lambda VERSION_REF=${VERSION_REF} && \
cp build/kubeapply-lambda /usr/local/bin

# Copy into final image
FROM public.ecr.aws/lambda/go:1

RUN yum install -y git

RUN curl -O https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py
RUN pip3 install awscli

COPY --from=builder /usr/local/bin/aws-iam-authenticator /usr/local/bin
COPY --from=builder /usr/local/bin/helm /usr/local/bin
COPY --from=builder /usr/local/bin/kubeval /usr/local/bin
COPY --from=builder /usr/local/bin/kubectl /usr/local/bin
COPY --from=builder /usr/local/bin/kubeapply /usr/local/bin
COPY --from=builder /usr/local/bin/kubeapply-lambda /usr/local/bin

CMD [ "/usr/local/bin/kubeapply-lambda" ]
4 changes: 2 additions & 2 deletions data/data.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.