File tree Expand file tree Collapse file tree 7 files changed +76
-88
lines changed Expand file tree Collapse file tree 7 files changed +76
-88
lines changed Original file line number Diff line number Diff line change 1+ steps :
2+ - label : Install dependencies
3+ env :
4+ SEGMENT_BUILDKITE_IMAGE : " buildkite-agent-golang1.19:latest"
5+ SEGMENT_CONTEXTS : ' snyk'
6+ agents :
7+ queue : v1
8+ commands : |
9+ which -a go
10+ env | grep PATH
11+ export PATH=$PATH:/go/bin:/var/lib/buildkite-agent/go/bin:/go/src/github.com/segmentio/kubeapply/deps:$HOME/local/bin
12+ mkdir -p deps
13+ cd deps && ../scripts/pull-deps.sh && cd -
14+ env | grep PATH
15+ ls -al "${HOME}/local/bin"
16+ which -a helm
17+ SNYK_LEVEL=FLHI curl -sL https://raw.githubusercontent.com/segmentio/snyk_helpers/master/initialization/snyk.sh | sh
18+
19+ - label : ' Publish'
20+ env :
21+ SEGMENT_CONTEXTS : " aws-credentials,ecr"
22+ SEGMENT_BUILDKITE_IMAGE : ' buildkite-agent-golang1.19:latest'
23+ agents :
24+ queue : v1
25+ commands : |
26+ export PATH=$PATH:/go/bin:/var/lib/buildkite-agent/go/bin:/go/src/github.com/segmentio/kubeapply/deps:$HOME/local/bin
27+ make publish
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11# Fetch or build all required binaries
2- FROM golang:1.18 as builder
2+ FROM golang:1.19 as builder
33
44ARG VERSION_REF
55RUN test -n "${VERSION_REF}"
@@ -8,6 +8,7 @@ ENV SRC github.com/segmentio/kubeapply
88
99RUN apt-get update && apt-get install --yes \
1010 curl \
11+ unzip \
1112 wget
1213
1314COPY . /go/src/${SRC}
Original file line number Diff line number Diff line change 11# Fetch or build all required binaries
2- FROM golang:1.18 as builder
2+ FROM golang:1.19 as builder
33
44ARG VERSION_REF
55RUN test -n "${VERSION_REF}"
@@ -8,6 +8,7 @@ ENV SRC github.com/segmentio/kubeapply
88
99RUN apt-get update && apt-get install --yes \
1010 curl \
11+ unzip \
1112 wget
1213
1314COPY . /go/src/${SRC}
@@ -26,7 +27,8 @@ RUN make kubeapply-lambda VERSION_REF=${VERSION_REF} && \
2627# Copy into final image
2728FROM public.ecr.aws/lambda/go:1
2829
29- RUN yum install -y git
30+ RUN yum install -y git && \
31+ python3 --version
3032
3133RUN curl -O https://bootstrap.pypa.io/pip/3.6/get-pip.py && python3 get-pip.py
3234RUN pip3 install awscli
Original file line number Diff line number Diff line change 7878.PHONY : clean
7979clean :
8080 rm -Rf * .zip .kube build vendor
81+
82+ publish :
83+ ./scripts/publish.sh
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -euo pipefail
4+
5+ AWS_ACCOUNT_ID=' 528451384384'
6+ AWS_REGION=' us-west-2'
7+
8+ main () {
9+ local -r SHORT_GIT_SHA=$( git rev-parse --short HEAD)
10+ local -r image=" ${AWS_ACCOUNT_ID} .dkr.ecr.${AWS_REGION} .amazonaws.com/kubeapply:${SHORT_GIT_SHA} "
11+ local -r lambda_image=" ${AWS_ACCOUNT_ID} .dkr.ecr.${AWS_REGION} .amazonaws.com/kubeapply-lambda:${SHORT_GIT_SHA} "
12+ docker build \
13+ -t " ${image} " \
14+ --build-arg VERSION_REF=" ${SHORT_GIT_SHA} " \
15+ .
16+ docker push " ${image} "
17+
18+ docker build \
19+ -f Dockerfile.lambda \
20+ -t " ${lambda_image} " \
21+ --build-arg VERSION_REF=" ${SHORT_GIT_SHA} " \
22+ .
23+ docker push " ${lambda_image} "
24+ }
25+
26+ main " $@ "
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -e
3+ set -euo pipefail
4+
5+ # Note this is used by both the publish script and the test script.
46
57# Required versions
68
@@ -23,11 +25,15 @@ KIND_SHA_256_SUM="781c3db479b805d161b7c2c7a31896d1a504b583ebfcce8fcd49538c684d96
2325GOOS=linux
2426GOARCH=amd64
2527
28+ mkdir -p " ${HOME} /local/bin"
29+
2630echo " Downloading helm at version ${HELM_VERSION} "
2731wget -q https://get.helm.sh/helm-v${HELM_VERSION} -${GOOS} -${GOARCH} .tar.gz
2832echo " ${HELM_SHA256_SUM} helm-v${HELM_VERSION} -${GOOS} -${GOARCH} .tar.gz" | sha256sum -c
2933tar -xzf helm-v${HELM_VERSION} -${GOOS} -${GOARCH} .tar.gz
30- cp ${GOOS} -${GOARCH} /helm .
34+ ${GOOS} -${GOARCH} /helm version
35+ # try /usr/local/bin (for Dockerfile) and fall back
36+ cp ${GOOS} -${GOARCH} /helm " /usr/local/bin" || cp ${GOOS} -${GOARCH} /helm " ${HOME} /local/bin"
3137
3238echo " Downloading aws-iam-authenticator at version ${IAM_AUTHENTICATOR_VERSION} "
3339wget -q -O aws-iam-authenticator https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v${IAM_AUTHENTICATOR_VERSION} /aws-iam-authenticator_${IAM_AUTHENTICATOR_VERSION} _${GOOS} _${GOARCH}
@@ -44,3 +50,9 @@ echo "Downloading kind at version ${KIND_VERSION}"
4450wget -q -O kind https://kind.sigs.k8s.io/dl/${KIND_VERSION} /kind-${GOOS} -${GOARCH}
4551echo " ${KIND_SHA_256_SUM} kind" | sha256sum -c
4652chmod +x kind
53+
54+ # https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
55+ curl " https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o " awscliv2.zip"
56+ unzip -q awscliv2.zip
57+ mkdir -p " ${HOME} /local/aws"
58+ ./aws/install --install-dir " ${HOME} /local/aws" --bin-dir " ${HOME} /local/bin"
You can’t perform that action at this time.
0 commit comments