forked from vespa-engine/docker-image-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscrewdriver.yaml
99 lines (86 loc) · 3.13 KB
/
screwdriver.yaml
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
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
shared:
image: vespaengine/vespa-pipeline:latest
secrets:
- DOCKER_HUB_DEPLOY_KEY
environment:
USER_SHELL_BIN: bash
annotations:
screwdriver.cd/restrictPR: fork
screwdriver.cd/cpu: HIGH
screwdriver.cd/ram: HIGH
screwdriver.cd/disk: HIGH
screwdriver.cd/timeout: 60
screwdriver.cd/dockerEnabled: true
screwdriver.cd/dockerCpu: TURBO
screwdriver.cd/dockerRam: TURBO
inspect: &inspect
inspect: |
set -x
env | grep -v TOKEN
cat /proc/cpuinfo
cat /proc/meminfo
df -h
uname -a
install-deps: &install-deps
install-deps: |
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf install -y --allowerasing docker-ce-cli
build-and-publish: &build-and-publish
build-and-publish: |
IFS=',' read -r -a PARSED <<< "$CONTAINER_ARCH"
PLATFORMS=$(for A in ${PARSED[@]}; do echo "linux/$A"; done | xargs | sed 's/\ /,/g')
if [[ -z $SD_PULL_REQUEST ]]; then
set +x
docker login -u aressem -p $DOCKER_HUB_DEPLOY_KEY
set -x
DOCKER_BUILDX_PUSH="--push"
fi
cd $CONTAINER_DIR
docker info
docker version
docker buildx version
docker buildx install
unset DOCKER_HOST
docker context create vespa-context --docker "host=tcp://localhost:2376,ca=/certs/client/ca.pem,cert=/certs/client/cert.pem,key=/certs/client/key.pem"
docker context use vespa-context
docker buildx create --name vespa-builder --driver docker-container --use
docker buildx inspect --bootstrap
docker buildx build --progress plain $DOCKER_BUILDX_PUSH --platform $PLATFORMS --tag $CONTAINER_IMAGE:$CONTAINER_TAG .
teardown-inspect: &teardown-inspect
teardown-inspect: |
df -h
common-steps: &common-steps
steps:
- *inspect
- *install-deps
- *build-and-publish
- *teardown-inspect
jobs:
publish-build-almalinux-8:
sourcePaths: ["screwdriver.yaml", "build/almalinux-8/"]
requires: [~pr, ~commit]
environment:
CONTAINER_ARCH: "amd64,arm64"
CONTAINER_DIR: 'build/almalinux-8'
CONTAINER_IMAGE: 'docker.io/vespaengine/vespa-build-almalinux-8'
CONTAINER_TAG: 'latest'
<<: *common-steps
publish-dev-almalinux-8:
sourcePaths: ["screwdriver.yaml", "dev/almalinux-8/"]
requires: [~pr, ~commit, ~publish-build-almalinux-8]
environment:
CONTAINER_ARCH: "amd64,arm64"
CONTAINER_DIR: 'dev/almalinux-8'
CONTAINER_IMAGE: 'docker.io/vespaengine/vespa-dev-almalinux-8'
CONTAINER_TAG: 'latest'
<<: *common-steps
publish-build-almalinux-9:
sourcePaths: ["screwdriver.yaml", "build/almalinux-9/"]
requires: [~pr, ~commit]
environment:
CONTAINER_ARCH: "amd64,arm64"
CONTAINER_DIR: 'build/almalinux-9'
CONTAINER_IMAGE: 'docker.io/vespaengine/vespa-build-almalinux-9'
CONTAINER_TAG: 'latest'
<<: *common-steps