Skip to content

Commit 72a9e21

Browse files
committed
[MENT-29] azure CI install ubuntu from tar
1 parent 9a6a0f0 commit 72a9e21

File tree

2 files changed

+72
-57
lines changed

2 files changed

+72
-57
lines changed

azure-pipelines.yml

Lines changed: 64 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
resources:
22
containers:
33

4-
- container: ubuntu-1604
5-
image: ubuntu:16.04
6-
options: "--name ubuntu-1604 --add-host=mariadb.example.com:127.0.0.1 -v /usr/bin/docker:/tmp/docker:ro"
7-
84
- container: ubuntu-1804
95
image: ubuntu:18.04
106
options: "--name ubuntu-1804 --add-host=mariadb.example.com:127.0.0.1 -v /usr/bin/docker:/tmp/docker:ro"
@@ -22,7 +18,6 @@ jobs:
2218
mkdir tmp
2319
chmod 777 .travis/gen-ssl.sh
2420
.travis/gen-ssl.sh mariadb.example.com tmp
25-
ls -lrt tmp
2621
cp -R tmp $BUILD_ARTIFACTSTAGINGDIRECTORY
2722
displayName: 'create SSL certificates'
2823
@@ -60,7 +55,6 @@ jobs:
6055
displayName: 'install node.js'
6156
6257
- script: |
63-
dir $(System.DefaultWorkingDirectory)\win_build\
6458
for /f %%a in ('dir /B $(System.DefaultWorkingDirectory)\win_build\mariadb-enterprise-10.*-winx64.msi') do set servername=$(System.DefaultWorkingDirectory)\win_build\%%a
6559
echo %servername%
6660
msiexec /i %servername% INSTALLDIR=c:\projects\server SERVICENAME=mariadb ALLOWREMOTEROOTACCESS=true /qn
@@ -70,7 +64,6 @@ jobs:
7064
7165
- script: |
7266
echo 127.0.0.1 mariadb.example.com >> %WINDIR%\System32\Drivers\Etc\Hosts
73-
dir
7467
displayName: 'set hostname'
7568
7669
- script: |
@@ -79,6 +72,12 @@ jobs:
7972
8073
- script: |
8174
npm test
75+
if %ERRORLEVEL% EQU 0 (
76+
echo Success
77+
) else (
78+
echo exit code is %errorlevel%
79+
exit /b %errorlevel%
80+
)
8281
displayName: 'run tests'
8382
env:
8483
TEST_HOST: "mariadb.example.com"
@@ -93,14 +92,11 @@ jobs:
9392
- job: RunInContainer
9493
pool:
9594
vmImage: 'ubuntu-16.04'
96-
displayName: 'test ubuntu xenial+bionic'
95+
displayName: 'test ubuntu bionic'
9796
dependsOn:
9897
- SSLFiles
9998
strategy:
10099
matrix:
101-
ubuntu-1604:
102-
containerImage: ubuntu-1604
103-
containerName: xenial
104100
ubuntu-1804:
105101
containerImage: ubuntu-1804
106102
containerName: bionic
@@ -122,7 +118,7 @@ jobs:
122118
inputs:
123119
source: 'specific'
124120
project: '550599d3-6165-4abd-8c86-e3f7e53a1847'
125-
artifact: '$(containerImage)-deb'
121+
artifact: '$(containerImage)'
126122
pipeline: 3
127123
runVersion: 'latestFromBranch'
128124
runBranch: 'refs/heads/10.4-enterprise'
@@ -139,85 +135,96 @@ jobs:
139135
runBranch: 'refs/heads/es-mariadb-4.x'
140136
downloadPath: $(System.DefaultWorkingDirectory)
141137

138+
142139
- script: |
143-
ls -lrt .
140+
tar xf mariadb-enterprise*
141+
144142
sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime
145143
146144
sudo apt-get update && sudo apt-get install -y --no-install-recommends apt-transport-https ca-certificates tzdata pwgen
147145
export DEBIAN_FRONTEND="noninteractive"
148146
sudo debconf-set-selections <<< "mariadb-server-10.4 mysql-server/root_password password P4ssw@rd"
149147
sudo debconf-set-selections <<< "mariadb-server-10.4 mysql-server/root_password_again password P4ssw@rd"
150148
sudo apt-get update -y
149+
sudo apt-get install --allow-unauthenticated -f -y libaio1 libaio-dev libxml2 libcurl4 curl libc-dev linux-libc-dev libc-dev-bin libdbi-perl rsync socat libnuma1 zlib1g-dev libreadline5 libjemalloc1 libsnappy1v5 libcrack2 gawk lsof psmisc perl libreadline5
151150
152-
sudo apt-get install --allow-unauthenticated -y curl libdbi-perl rsync socat libnuma1 libaio1 zlib1g-dev libreadline5 libjemalloc1 libsnappy1v5 libcrack2 gawk lsof psmisc libaio1 perl libreadline5
153-
154-
echo 'Installing deb files'
155-
ls -lrt binary
156-
sudo chmod 777 binary
157-
sudo chmod 777 binary/*
158-
cd binary
159-
rm -R ./mariadb-plugin*
160-
rm -R */*-dev*.deb
161-
rm -R ./*-test*.deb
162-
rm -R ./galera-arbitrator*.deb
163-
sudo apt install -f -y ./*.deb
164-
165-
#sudo sed -i 's/secure-file-priv/#secure-file-priv/g' /etc/mysql/conf.d/mariadb-enterprise.cnf
166-
sudo tail -n 5000 /etc/mysql/conf.d/mariadb-enterprise.cnf
151+
cd mariadb-enterprise*/
152+
sudo groupadd mysql
153+
sudo useradd -g mysql mysql
167154
168-
sudo touch /etc/mysql/ssl.cnf
169-
sudo chmod 777 /etc/mysql/ssl.cnf
170-
sudo echo '[mysqld]' >> /etc/mysql/ssl.cnf
171-
sudo bash -c 'echo "ssl-ca=$(System.DefaultWorkingDirectory)/tmp/ca.crt" >> /etc/mysql/ssl.cnf'
172-
sudo bash -c 'echo "ssl-cert=$(System.DefaultWorkingDirectory)/tmp/server.crt" >> /etc/mysql/ssl.cnf'
173-
sudo bash -c 'echo "ssl-key=$(System.DefaultWorkingDirectory)/tmp/server.key" >> /etc/mysql/ssl.cnf'
155+
export PROJ_PATH=`pwd`
156+
echo $PROJ_PATH
174157
175-
sudo tail -n 5000 /etc/mysql/ssl.cnf
158+
cat <<EOT >> my.cnf
159+
[mysqld]
160+
port=3306
161+
max_allowed_packet=16M
162+
datadir=$PROJ_PATH/data
163+
socket=/tmp/mysql.sock
164+
user=mysql
165+
ssl-ca=$(System.DefaultWorkingDirectory)/tmp/ca.crt
166+
ssl-cert=$(System.DefaultWorkingDirectory)/tmp/server.crt
167+
ssl-key=$(System.DefaultWorkingDirectory)/tmp/server.key
168+
EOT
176169
177-
sudo mysql_install_db
170+
sudo chown mysql $PROJ_PATH/my.cnf
171+
sudo tail -n 5000 $PROJ_PATH/my.cnf
178172
179-
sudo service mysql status
180-
sudo service mysql start
181-
sudo service mysql status
173+
sudo chmod 777 $PROJ_PATH
174+
sudo ln -s $PROJ_PATH /usr/local/mysql
182175
183-
#temporary fix for error in mariadb-enterprise.cnf
184-
#sudo apt purge -y mariadb-server
185-
#sudo apt purge -y mariadb-server-10.4
176+
sudo ./scripts/mysql_install_db --defaults-file=$PROJ_PATH/my.cnf --user=mysql
177+
sudo chown -R root .
178+
sudo chown -R mysql data
186179
187-
#reinstall
188-
#sudo apt install -f -y ./*.deb
189-
190-
#systemctl status mariadb.service
191-
#/usr/sbin/mysqld &
180+
export PATH=$PATH:$PROJ_PATH/bin/
192181
193182
env:
194183
WORKING_DIR: $(System.DefaultWorkingDirectory)
195184
displayName: 'install server'
196185
197-
- script: |
198-
sudo mysql -e "CREATE USER 'someUser'@'%' identified by 'Passw@rd2';"
199-
sudo mysql -e "GRANT ALL on *.* to 'someUser'@'%' identified by 'Passw@rd2' with grant option;"
200-
sudo mysql -e "CREATE DATABASE testn;"
201-
displayName: 'Add non socket user'
202-
203186
- script: |
204187
sudo apt-get install -y curl
205188
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
206189
sudo apt-get update
207190
sudo apt-get install -y nodejs
208-
ls -lrt /usr/bin/nodejs
209-
210-
ls -lrt /usr/lib/node_modules
211191
212192
nodejs -v
213193
node -v
214194
npm -v
215195
displayName: 'Install node.js'
216196
217197
- script: |
218-
ls -lrt
198+
cd mariadb-enterprise*/
199+
sudo ./bin/mysqld --defaults-file=./my.cnf &
200+
201+
for i in {30..0}; do
202+
if sudo ./bin/mysql -e "SELECT 1" &> /dev/null; then
203+
echo 'MySQL connected...'
204+
break
205+
fi
206+
echo 'MySQL init process in progress...'
207+
sleep 1
208+
done
209+
if [ "$i" = 0 ]; then
210+
echo >&2 'MySQL init process failed.'
211+
sudo ./bin/mysql -e "SELECT 1"
212+
exit 1
213+
fi
214+
215+
sudo ./bin/mysql -e "CREATE USER 'someUser'@'%' identified by 'Passw@rd2';"
216+
sudo ./bin/mysql -e "GRANT ALL on *.* to 'someUser'@'%' identified by 'Passw@rd2' with grant option;"
217+
sudo ./bin/mysql -e "CREATE DATABASE testn;"
218+
219+
cd ..
220+
219221
npm install
220222
npm test
223+
if [ $? -ne 0 ]; then
224+
exit 1
225+
fi
226+
cd mariadb-enterprise*/
227+
sudo ./bin/mysqladmin shutdown
221228
env:
222229
TEST_HOST: "mariadb.example.com"
223230
RUN_LONG_TEST: 1

test/integration/test-debug.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ describe('debug', () => {
3333
.catch(done);
3434
});
3535

36+
//ensure that debug from previous test are written to console
37+
afterEach(done => {
38+
setTimeout(() => {
39+
done();
40+
}, 1000);
41+
});
42+
43+
3644
after(done => {
3745
fs.unlink(smallFileName, done);
3846
});

0 commit comments

Comments
 (0)