Skip to content

Commit 23551c6

Browse files
committed
Add yq, helm3, kustomize
1 parent 34d819d commit 23551c6

5 files changed

Lines changed: 33 additions & 44 deletions

File tree

.github/workflows/default.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
---
2-
name: 'build images'
2+
name: "build images"
33

44
on:
55
push:
66
branches:
7-
- main
7+
- master
88
workflow_dispatch:
9-
9+
pull_request:
10+
schedule:
11+
- cron: '0 16 * * 0' # Every Sunday at 4PM
12+
1013
jobs:
1114
build:
1215
name: "Build: ${{ matrix.version }}"
@@ -16,13 +19,12 @@ jobs:
1619
fail-fast: false # Don't cancel other jobs if one fails
1720
matrix:
1821
include:
19-
- version: '7.4'
20-
- version: '8.0'
21-
- version: '8.1'
22-
22+
- version: "7.4"
23+
- version: "8.0"
24+
- version: "8.1"
2325
env:
2426
VERSION: ${{ matrix.version }}
25-
27+
2628
steps:
2729
- name: Checkout
2830
uses: actions/checkout@v2
@@ -32,9 +34,8 @@ jobs:
3234
run: |
3335
DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPOSITORY#*/}
3436
VERSION=php${{ matrix.version }}
35-
SHORTREF=${GITHUB_SHA::8}
3637
37-
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}"
38+
TAGS="${DOCKER_IMAGE}:${VERSION},ghcr.io/${DOCKER_IMAGE}:${VERSION}"
3839
3940
# Set output parameters.
4041
echo ::set-output name=tags::${TAGS}
@@ -55,9 +56,10 @@ jobs:
5556
with:
5657
username: ${{ secrets.DOCKER_USERNAME }}
5758
password: ${{ secrets.DOCKER_TOKEN }}
58-
# -
59-
# name: Login to GitHub Container Registry
60-
# uses: docker/login-action@v1
59+
60+
# - name: Login to GitHub Container Registry
61+
# if: github.event_name != 'pull_request'
62+
# uses: docker/login-action@v1
6163
# with:
6264
# registry: ghcr.io
6365
# username: ${{ github.repository_owner }}

build.sh

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
#!/bin/sh
22

3-
set -e
3+
set -ex
44

5-
# Arguments: $1 tag, $2 CLI_VERSION
6-
build() {
7-
docker build \
8-
--build-arg CLI_VERSION="${2}-${1}" \
9-
-t outrigger/cli:"${2}-${1}" \
10-
.
11-
}
12-
13-
build "php7.2" "2.10"
14-
15-
for tag in "php7.3" "php7.4"; do
16-
build $tag "2.12"
17-
done
5+
# Arguments: $1 CLI_VERSION
6+
docker build --build-arg CLI_VERSION=php"${1:-8.0}" -t phase2/docker-cli:php"${1:-8.0}" ./src

hooks/build

Lines changed: 0 additions & 6 deletions
This file was deleted.

hooks/post_push

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/Dockerfile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,29 @@ RUN curl -o /usr/local/bin/kubectl -LO "https://storage.googleapis.com/kubernete
3838
./install_helm.sh -v ${HELM_VERSION} && \
3939
helm init --client-only
4040

41+
# Also install helm3 as `helm3`
42+
RUN curl -s https://get.helm.sh/helm-v3.6.2-linux-"$(dpkg --print-architecture)".tar.gz | sudo tar -C /tmp --no-same-owner -xvzf - linux-amd64/helm --strip-components 1 && \
43+
mv /tmp/helm /bin/helm3
44+
45+
# Install Kustomize
46+
# https://kubectl.docs.kubernetes.io/installation/kustomize/binaries/
47+
RUN cd /bin/ && curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
48+
4149
# Install AWS cli
4250
COPY awscli.pubkey /tmp/
43-
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \
51+
RUN curl https://awscli.amazonaws.com/awscli-exe-linux-"$(uname -m)".zip -o "awscliv2.zip" && \
4452
gpg --import /tmp/awscli.pubkey && \
45-
curl -s -o awscliv2.sig https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip.sig && \
53+
curl -s -o awscliv2.sig https://awscli.amazonaws.com/awscli-exe-linux-"$(uname -m)".zip.sig && \
4654
gpg --verify awscliv2.sig awscliv2.zip && \
4755
unzip -q awscliv2.zip && \
4856
./aws/install && \
4957
rm awscliv2.zip && rm -rf aws
5058

59+
# Install yq
60+
# https://mikefarah.gitbook.io/yq/#wget
61+
RUN wget https://github.com/mikefarah/yq/releases/download/v4.21.1/yq_linux_"$(dpkg --print-architecture)".tar.gz -O - |\
62+
tar xz && mv yq_linux_amd64 /usr/bin/yq
63+
5164
# All further commands will be performed as the docker user.
5265
USER docker
5366
SHELL ["/bin/bash", "-c"]

0 commit comments

Comments
 (0)