forked from mariadb-kester/mariadbMaxscaleDocker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
52 lines (43 loc) · 1.78 KB
/
Makefile
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
#------------------------------------------------------------------
# Project build information
#------------------------------------------------------------------
VERSION=${CIRCLE_SHA1}
IMAGE=mariadb-maxscale:latest
BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
# Load Secrets from CircleCI and pass in to build script as a variable to be set within the container
#------------------------------------------------------------------
# CI targets
#------------------------------------------------------------------
build:
docker build --build-arg BUILD_DATE="${BUILD_DATE}" \
--build-arg VCS_REF="1" \
--build-arg VERSION="${VERSION}" \
--build-arg HTTPS_SETTING="on" \
--build-arg IMAGE_VERSION="${IMAGE}" \
--build-arg MAXSCALE_VERSION="${MAXSCALE_VERSION}" \
--build-arg MARIADB_TOKEN="${MARIADB_TOKEN}" \
-t ${IMAGE} .
push-to-digitalocean:
doctl registry login
docker tag ${IMAGE} ${DO_REPO}/${IMAGE}
docker push ${DO_REPO}/${IMAGE}
install-doctl-linux:
wget https://github.com/digitalocean/doctl/releases/download/v1.54.0/doctl-1.54.0-linux-amd64.tar.gz
tar xf doctl-1.54.0-linux-amd64.tar.gz
mv doctl /usr/local/bin
doctl auth init -t ${DO_ACCESS_TOKEN}
install-docker:
apk add docker
local-build:
docker build --build-arg BUILD_DATE="${BUILD_DATE}" \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VERSION=${VERSION} \
--build-arg HTTPS_SETTING="off" \
--build-arg IMAGE_VERSION="${IMAGE}" \
--build-arg MAXSCALE_VERSION="${MAXSCALE_VERSION}" \
--build-arg MARIADB_TOKEN="${MARIADB_TOKEN}" \
-t maxscale:latest .
#scan: build
scan:
export TRIVY_TIMEOUT_SEC=360s
trivy image ${IMAGE}