forked from mayadata-io/cstor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
159 lines (156 loc) · 5.81 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
stages:
- build
- baseline
build-zfs-0:
stage: build
only:
refs:
- /^(v[0-9][.][0-9][.]x|zfs-0.7-release)?$/
before_script:
- echo $HOME
- export BRANCH=${CI_COMMIT_REF_NAME}
- echo $BRANCH
- export COMMIT=${CI_COMMIT_SHORT_SHA}
- echo $FIO_SRCDIR
- apt-get update
- apt-get install --yes sudo git-core
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
- sudo apt-get install --yes -qq gcc-6 g++-6
- sudo apt-get install --yes -qq build-essential autoconf libtool gawk alien fakeroot linux-headers-$(uname -r) libaio-dev
- sudo apt-get install --yes -qq zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev libssl-dev libjson-c-dev
- sudo apt-get install --yes -qq lcov libjemalloc-dev libelf-dev net-tools bc kmod linux-modules-4.15.0-1025-gcp
# packages for tests
- sudo apt-get install --yes -qq parted lsscsi ksh attr acl nfs-kernel-server fio
- sudo apt-get install --yes -qq libgtest-dev cmake
# packages for debugging
- sudo apt-get install --yes gdb
# use gcc-6 by default
- sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-6 /usr/bin/gcc
- sudo unlink /usr/bin/g++ && sudo ln -s /usr/bin/g++-6 /usr/bin/g++
- echo "CSTOR"
- echo $COMMIT
- pushd .
- cd /usr/src/gtest
- sudo cmake CMakeLists.txt
- sudo make -j4
- sudo cp *.a /usr/lib
- popd
- pushd .
- cd ..
# we need fio repo to build zfs replica fio engine
- git clone https://github.com/axboe/fio
- cd fio
- git checkout fio-3.7
- ./configure
- sudo make -j4
- cd ..
- git clone https://github.com/openebs/spl
- cd spl
- git checkout spl-0.7.9
- sudo sh autogen.sh
- ./configure
script:
- make -j4
- popd
- sh autogen.sh
- echo $PWD
- ./configure --with-config=user --enable-code-coverage=yes --enable-debug --enable-uzfs=yes --with-jemalloc --with-fio=$PWD/../fio
- make -j4
- make cstyle
- export FIO_SRCDIR=$PWD/../fio
- echo $FIO_SRCDIR
# - sudo bash ./print_debug_info.sh &
# - bash ./tests/cbtest/script/test_uzfs.sh -T all
- ./build_image.sh
build-zfs-1:
stage: build
only:
refs:
- /^(v[0-9][.][0-9][.]x|zfs-0.7-release)?$/
before_script:
- echo $HOME
- export BRANCH=${CI_COMMIT_REF_NAME}
- echo $BRANCH
- export COMMIT=${CI_COMMIT_SHORT_SHA}
- echo $FIO_SRCDIR
- apt-get update
- apt-get install --yes sudo git-core
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
- sudo apt-get install --yes -qq gcc-6 g++-6
- sudo apt-get install --yes -qq build-essential autoconf libtool gawk alien fakeroot linux-headers-$(uname -r) libaio-dev
- sudo apt-get install --yes -qq zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev libssl-dev libjson-c-dev
- sudo apt-get install --yes -qq lcov libjemalloc-dev libelf-dev net-tools bc kmod linux-modules-4.15.0-1025-gcp
# packages for tests
- sudo apt-get install --yes -qq parted lsscsi ksh attr acl nfs-kernel-server fio
- sudo apt-get install --yes -qq libgtest-dev cmake
# packages for debugging
- sudo apt-get install --yes gdb
# use gcc-6 by default
- sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-6 /usr/bin/gcc
- sudo unlink /usr/bin/g++ && sudo ln -s /usr/bin/g++-6 /usr/bin/g++
- echo "CSTOR"
- echo $COMMIT
- pushd .
- cd /usr/src/gtest
- sudo cmake CMakeLists.txt
- sudo make -j4
- sudo cp *.a /usr/lib
- popd
- pushd .
- cd ..
# we need fio repo to build zfs replica fio engine
- git clone https://github.com/axboe/fio
- cd fio
- git checkout fio-3.7
- ./configure
- sudo make -j4
- cd ..
- git clone https://github.com/openebs/spl
- cd spl
- git checkout spl-0.7.9
- sudo sh autogen.sh
- ./configure
script:
- make --no-print-directory -s pkg-utils pkg-kmod
- sudo dpkg -i *.deb
- popd
- echo $FIO_SRCDIR
- sh autogen.sh
- ./configure --enable-code-coverage=yes --enable-debug
- make --no-print-directory -s pkg-utils pkg-kmod
- sudo dpkg -i *.deb
- make cstyle
- sudo /sbin/modprobe zfs
- /sbin/ztest
baseline-image:
stage: baseline
only:
refs:
- /^(v[0-9][.][0-9][.]x|zfs-0.7-release)?$/
image: atulabhi/kops:v10
before_script: []
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" == "zfs-0.7-release" ]] ; 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" == "zfs-0.7-release" ]] ; then export INFRA="master" ; else export INFRA=$BRANCH ; fi
- curl -X POST -F variable[INFRA_BRANCH]=$INFRA -F token=$PACKET -F ref=k8s-1-11 https://gitlab.openebs.ci/api/v4/projects/27/trigger/pipeline
- curl -X POST -F variable[INFRA_BRANCH]=$INFRA -F token=$PACKET -F ref=k8s-1-12 https://gitlab.openebs.ci/api/v4/projects/27/trigger/pipeline
- curl -X POST -F variable[INFRA_BRANCH]=$INFRA -F token=$PACKET -F ref=k8s-1-13 https://gitlab.openebs.ci/api/v4/projects/27/trigger/pipeline