-
Notifications
You must be signed in to change notification settings - Fork 72
/
.gitlab-ci.yml
72 lines (70 loc) · 3.01 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
stages:
- build
- baseline
build-istgt:
stage: build
only:
refs:
- /^(v[0-9][.][0-9][.]x|replication)?$/
before_script:
- echo $HOME
- whoami
- export BRANCH=${CI_COMMIT_REF_NAME}
- echo $BRANCH
- export COMMIT=${CI_COMMIT_SHORT_SHA}
- apt-get update
- apt-get install --yes psmisc git-core net-tools rsyslog sudo ioping
- apt-get install --yes software-properties-common wget autoconf lsof
- add-apt-repository -y ppa:ubuntu-toolchain-r/test
- apt-get update -qq
- apt-get install --yes -qq build-essential gcc-6 g++-6 gdb jq
- apt-get install --yes libssl-dev libjson-c-dev
# use gcc-6 by default
- unlink /usr/bin/gcc && ln -s /usr/bin/gcc-6 /usr/bin/gcc
- unlink /usr/bin/g++ && ln -s /usr/bin/g++-6 /usr/bin/g++
script:
- ./autogen.sh
# we are running build two times. One is without replication code and
# another one is with replication code. The reason behind running build
# without replication code is to make sure that replication feature
# related code doesn't break the existing target code.
- ./configure
- make
- make clean
- ./configure --enable-debug --enable-replication
- make
# run ztest and test supported zio backends
# - sudo bash ./print_debug_info.sh &
# - sudo bash ./test_istgt.sh
- pwd
- ./build_image.sh
baseline-image:
stage: baseline
only:
refs:
- /^(v[0-9][.][0-9][.]x|replication)?$/
image: atulabhi/kops:v10
script:
- pwd
- apt-get update
- apt-get install --yes git-core
- git config --global user.name "OpenEBS CI Bot"
- git config --global user.email [email protected]
- export BRANCH=${CI_COMMIT_REF_NAME}
- echo $BRANCH
- export COMMIT=${CI_COMMIT_SHORT_SHA}
- echo $COMMIT
- git clone https://github.com/openebs/e2e-infrastructure.git
- if [[ "$BRANCH" == "replication" ]] ; then git checkout master ; else git checkout $BRANCH ; fi
- cd e2e-infrastructure/baseline
- ansible-playbook commit-writer.yml --extra-vars "branch=$BRANCH repo=$CI_PROJECT_NAME commit=$COMMIT"
- git status
- git add baseline
- git status
- git commit -m "updated $CI_PROJECT_NAME commit:$COMMIT"
- git push https://$user:[email protected]/openebs/e2e-infrastructure.git --all
- if [[ "$BRANCH" == "replication" ]] ; then export INFRA="master" ; else export INFRA=$BRANCH ; fi
# - curl -X POST -F variable[INFRA_BRANCH]=$INFRA -F token=$PACKET -F ref=k8s-ultimate https://gitlab.openebs.ci/api/v4/projects/27/trigger/pipeline
# - curl -X POST -F variable[INFRA_BRANCH]=$INFRA -F token=$PACKET -F ref=k8s-penultimate https://gitlab.openebs.ci/api/v4/projects/27/trigger/pipeline
# - curl -X POST -F variable[INFRA_BRANCH]=$INFRA -F token=$PACKET -F ref=k8s-antepenultimate https://gitlab.openebs.ci/api/v4/projects/27/trigger/pipeline
# - curl -X POST -F token=$KONVOY -F ref=$KONVOY_BRANCH https://gitlab.openebs100.io/api/v4/projects/34/trigger/pipeline