Skip to content

Commit dca00c6

Browse files
Merge pull request #16 from codefresh-io/v1.15
V1.15
2 parents af37e14 + 8a8aa74 commit dca00c6

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ FROM alpine:3.6 AS builder
22

33
RUN apk update && apk add curl
44

5+
RUN curl -o kubectl1.14 -L https://storage.googleapis.com/kubernetes-release/release/v1.14.0/bin/linux/amd64/kubectl
6+
RUN curl -o kubectl1.15 -L https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/linux/amd64/kubectl
57
RUN curl -o kubectl1.10 -L https://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/kubectl
68
RUN curl -o kubectl1.6 -L https://storage.googleapis.com/kubernetes-release/release/v1.6.0/bin/linux/amd64/kubectl
79

@@ -10,11 +12,13 @@ FROM alpine:3.6
1012

1113
RUN apk add --update bash
1214

13-
#copy both versions of kubectl to switch between them later.
15+
#copy all versions of kubectl to switch between them later.
16+
COPY --from=builder kubectl1.15 /usr/local/bin/
17+
COPY --from=builder kubectl1.14 /usr/local/bin/
1418
COPY --from=builder kubectl1.10 /usr/local/bin/kubectl
1519
COPY --from=builder kubectl1.6 /usr/local/bin/
1620

17-
RUN chmod +x /usr/local/bin/kubectl /usr/local/bin/kubectl1.6
21+
RUN chmod +x /usr/local/bin/kubectl /usr/local/bin/kubectl1.6 /usr/local/bin/kubectl1.14 /usr/local/bin/kubectl1.15
1822

1923
WORKDIR /
2024

cf-deploy-kubernetes.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,11 @@ fi
6262
#check the cluster version and decide which version of kubectl to use:
6363
SERVER_VERSION=$(kubectl version --short=true --context "${KUBECONTEXT}" | grep -i server | cut -d ':' -f2 | cut -d '.' -f2 | sed 's/[^0-9]*//g')
6464
echo "Server minor version: $SERVER_VERSION"
65-
if (( "$SERVER_VERSION" <= "6" )); then mv /usr/local/bin/kubectl1.6 /usr/local/bin/kubectl; fi 2>/dev/null
66-
67-
65+
if (( "$SERVER_VERSION" <= "6" )); then cp -f /usr/local/bin/kubectl1.6 /usr/local/bin/kubectl; fi 2>/dev/null
66+
if (( "$SERVER_VERSION" == "14" )); then cp -f /usr/local/bin/kubectl1.14 /usr/local/bin/kubectl; fi 2>/dev/null
67+
if (( "$SERVER_VERSION" >= "15" )); then cp -f /usr/local/bin/kubectl1.15 /usr/local/bin/kubectl; fi 2>/dev/null
6868
[ ! -f "${deployment_file}" ] && echo "Couldn't find $deployment_file file at $(pwd)" && exit 1;
6969

70-
7170
DEPLOYMENT_FILE=${deployment_file}-$(date '+%y-%m-%d_%H-%M-%S').yml
7271
$(dirname $0)/template.sh "$deployment_file" > "$DEPLOYMENT_FILE" || fatal "Failed to apply deployment template on $deployment_file"
7372

0 commit comments

Comments
 (0)