forked from sustainableis/step-kubectl
-
Notifications
You must be signed in to change notification settings - Fork 9
/
ewok.yml
113 lines (99 loc) · 3.64 KB
/
ewok.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
build:
box:
id: alpine
cmd: /bin/sh
steps:
# - shellcheck
- script:
name: install apk packages
code: apk update && apk add ca-certificates openssh curl
- script:
name: config
code: |
GCLOUD_VERSION="151.0.0-linux-x86_64"
export GCLOUD_DIRNAME="google-cloud-sdk"
export GCLOUD_SHA="53caea9133e3ed0efe26164e8a29751a3caf770f"
export GCLOUD_FILENAME="${GCLOUD_DIRNAME}-${GCLOUD_VERSION}.tar.gz"
export GCLOUD_URL="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/${GCLOUD_FILENAME}"
export UPX_VERSION="3.93"
export UPX_SHA="db4ec36b930e7d7e082d93124a59d38fbaedd1c0"
export UPX_DIRNAME="upx-${UPX_VERSION}-amd64_linux"
export UPX_FILENAME="${UPX_DIRNAME}.tar.xz"
export UPX_URL="https://github.com/upx/upx/releases/download/v${UPX_VERSION}/${UPX_FILENAME}"
echo "Installing version ${GCLOUD_VERSION} of the Google Cloud SDK"
- script:
name: fetch upx
code: |
curl -L ${UPX_URL} -o ${UPX_FILENAME}
- script:
name: validate upx archive
code: |
sha1sum ${UPX_FILENAME} | grep -q "${UPX_SHA}"
- script:
name: Extract upx archive
code: |
tar -xf ${UPX_FILENAME}
- script:
name: Fetch gcloud archive
code: |
curl -L ${GCLOUD_URL} -o ${GCLOUD_FILENAME}
- script:
name: Validate gcloud archive
code: |
sha1sum ${GCLOUD_FILENAME} | grep -q "${GCLOUD_SHA}"
- script:
name: Extract gcloud archive
code: |
tar -xzf ${GCLOUD_FILENAME}
- script:
name: Install kubectl gcloud component
code: |
yes | ${GCLOUD_DIRNAME}/bin/gcloud components install kubectl
- script:
name: Copy gcloud to output dir
code: |
cp -r "${GCLOUD_DIRNAME}" ${WERCKER_OUTPUT_DIR}
- script:
name: prepare output
code: |
cp "${WERCKER_ROOT}/LICENSE" "${WERCKER_ROOT}/README.md" "${WERCKER_ROOT}/run.sh" "${WERCKER_ROOT}/wercker.yml" "${WERCKER_ROOT}/wercker-step.yml" "$WERCKER_OUTPUT_DIR"
cd $WERCKER_OUTPUT_DIR
chmod ugo+rx "$WERCKER_OUTPUT_DIR/${GCLOUD_DIRNAME}/bin/gcloud"
rm -rf "${GCLOUD_DIRNAME}/platform/gsutil"
- script:
name: Compress kubectl
code: |
${UPX_DIRNAME}/upx -1 "$WERCKER_OUTPUT_DIR/${GCLOUD_DIRNAME}/bin/kubectl"
- script:
name: Measure output folder
code: |
du -csh $WERCKER_OUTPUT_DIR/*
du -csh $WERCKER_OUTPUT_DIR/${GCLOUD_DIRNAME}/*
test-busybox:
box:
id: busybox
cmd: /bin/sh
steps:
- script:
code: |
export WERCKER_KUBECTL_COMMAND="version --client"
export WERCKER_STEP_ROOT=$WERCKER_SOURCE_DIR
source run.sh
test-alpine:
box:
id: alpine
cmd: /bin/sh
steps:
- script:
code: |
export WERCKER_KUBECTL_COMMAND="version --client"
export WERCKER_STEP_ROOT=$WERCKER_SOURCE_DIR
source run.sh
test-debian:
box: debian
steps:
- script:
code: |
export WERCKER_KUBECTL_COMMAND="version --client"
export WERCKER_STEP_ROOT=$WERCKER_SOURCE_DIR
source run.sh