-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
82 lines (80 loc) · 2.63 KB
/
config.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
# Required variables
# REPO, IMAGE_NAME
# DOCKER_USER, DOCKER_PASS
version: 2.1
aliases:
- ¶meters
platforms:
default: linux/amd64,linux/arm64
type: string
influxdb_version:
default: alpine
type: string
- &docker
- image: drpsychick/dind-buildx:latest
- &steps
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Prepare docker buildx
command: |
docker version
docker buildx version
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker context create xbuilder
docker buildx create xbuilder --use
docker buildx inspect --bootstrap
- run:
name: Test default.env
command: |
docker buildx build --progress plain --platform linux/amd64 \
--build-arg INFLUXDB_VERSION=<< parameters.influxdb_version >> \
--tag $REPO/$IMAGE_NAME:test --load .
docker run --rm -it $REPO/$IMAGE_NAME:test influxd version
docker run --rm -it --env-file test.env $REPO/$IMAGE_NAME:test --test
- run:
name: Build and push all platforms
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin &> /dev/null || exit 1
export TAG=<< parameters.influxdb_version >>
docker buildx build --progress plain --platform << parameters.platforms >> \
--build-arg INFLUXDB_VERSION=<< parameters.influxdb_version >> \
--tag $REPO/$IMAGE_NAME:$TAG --push .
if [ "$TAG" = "1.8" ]; then
export TAG=latest
docker buildx build --progress plain --platform << parameters.platforms >> \
--build-arg INFLUXDB_VERSION=<< parameters.influxdb_version >> \
--tag $REPO/$IMAGE_NAME:$TAG --push .
fi
fi
jobs:
build:
parameters: *parameters
docker: *docker
steps: *steps
workflows:
version: 2
weekly:
triggers:
- schedule:
# mondays, 6:03 am, UTC
cron: "3 6 * * 1"
filters:
branches:
only:
- master
jobs:
- build:
matrix:
parameters:
platforms: ["linux/amd64,linux/arm64"]
influxdb_version: ["1.8", "1.7"]
build:
jobs:
- build:
matrix:
parameters:
platforms: ["linux/amd64,linux/arm64"]
influxdb_version: ["1.8", "1.7"]