-
Notifications
You must be signed in to change notification settings - Fork 8
/
.gitlab-ci.yml
89 lines (81 loc) · 2.33 KB
/
.gitlab-ci.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
default:
tags:
- kxi-gitlab-runner
stages:
- build
- test
.docker-beforescript:
stage: build
image: "docker:20.10.23"
before_script:
- |
if [ -z "$DOCKER_AUTH_CONFIG" ]
then
echo "\$DOCKER_AUTH_CONFIG not set, unable to authenticate against container registries"
exit 1
fi
- mkdir -p $HOME/.docker && echo $DOCKER_AUTH_CONFIG > $HOME/.docker/config.json
- echo ${INT_NEXUS_PASS_RW} | docker login ${INSIGHTS_DEV_NEXUS_REGISTRY} -u ${INT_NEXUS_USER_RW} --password-stdin
script:
- INSIGHTSVER=4.1.6
- wget https://${INT_NEXUS_USER_RO}:${INT_NEXUS_PASS_RO}@ext-nexus.kxi-dev.kx.com/repository/kx-insights-packages/kdbInsightsCore/${INSIGHTSVER}-rc1/kdb-insights-core.tar
- docker load < kdb-insights-core.tar
- wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
- chmod a+x /usr/local/bin/yq
- IMAGE_URL="$INSIGHTS_DEV_NEXUS_REGISTRY/benchmarking/nano:$(yq -r ".${TARGET}" version.yaml)"
- docker build -t "${IMAGE_URL}" .
- docker push "${IMAGE_URL}"
- docker rmi "${IMAGE_URL}"
- docker rmi kdb-insights-core:${INSIGHTSVER}
- echo "IMAGE_URL=${IMAGE_URL}" > img.env
docker-buildpub-push:
variables:
TARGET: "pub"
extends:
- .docker-beforescript
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
docker-builddev-push:
variables:
TARGET: "dev"
extends:
- .docker-beforescript
artifacts:
reports:
dotenv: img.env
rules:
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
.mthread:
stage: test
image:
name: "${IMAGE_URL}"
entrypoint: [""]
pull_policy: always
needs:
- job: docker-builddev-push
variables:
DBSIZE: tiny
APPDIR: /opt/kx/app
FLUSH: ${APPDIR}/flush/directmount.sh
QLIC: /tmp/qlic
RESULTDIR: ${APPDIR}/results
LOGDIR: ${APPDIR}/logs
before_script:
- mkdir -p "$QLIC"
- echo -n "$KDB_LICENSE_B64" | base64 -d > "$QLIC/kc.lic"
- cd ${APPDIR}
rules:
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
mthread-single:
extends:
- .mthread
script:
- echo "${APPDIR}/data" > ./partitions
- ./mthread.sh 1 full delete
mthread-multi:
extends:
- .mthread
script:
- echo "${APPDIR}/data0" > ./partitions
- echo "${APPDIR}/data1" >> ./partitions
- ./mthread.sh 3 full delete