Skip to content

Commit 362fb6e

Browse files
PBM migrate to docker compose plugin (#3680)
1 parent 9a58606 commit 362fb6e

File tree

3 files changed

+18
-41
lines changed

3 files changed

+18
-41
lines changed

pbm/hetzner-pbm-functional-tests-full.groovy

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,8 @@ pipeline {
5757
docker rm \$(docker ps -a -q) || true
5858
docker rmi -f \$(docker images -q | uniq) || true
5959
sudo rm -rf ./*
60-
if [ ! -f "/usr/local/bin/docker-compose" ] ; then
61-
if [ ${params.instance} = "docker-aarch64" ]; then
62-
sudo curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-aarch64 -o /usr/local/bin/docker-compose
63-
else
64-
sudo curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
65-
fi
66-
sudo chmod +x /usr/local/bin/docker-compose
67-
fi
60+
docker system prune -f
61+
sudo apt install -y docker-compose-plugin
6862
"""
6963
git poll: false, branch: params.TESTING_BRANCH, url: 'https://github.com/Percona-QA/psmdb-testing.git'
7064
sh """
@@ -76,10 +70,11 @@ pipeline {
7670
cp $PBM_MINIO_S3_YML ./conf/pbm/aws_minio.yaml
7771
cp $PBM_OSS_YML ./conf/pbm/oss.yaml
7872
if [ "${ADD_JENKINS_MARKED_TESTS}" = "true" ]; then JENKINS_FLAG="--jenkins"; else JENKINS_FLAG=""; fi
79-
PSMDB=perconalab/percona-server-mongodb:${PSMDB} docker-compose build --no-cache
80-
docker-compose up -d
81-
KMS_ID="${KMS_ID}" docker-compose run test pytest -s --junitxml=junit.xml --shard-id=${SHARD} --num-shards=10 \$JENKINS_FLAG ${params.PYTEST_PARAMS} || true
82-
docker-compose down -v --remove-orphans
73+
PSMDB=perconalab/percona-server-mongodb:${PSMDB} docker compose build easyrsa
74+
PSMDB=perconalab/percona-server-mongodb:${PSMDB} docker compose build
75+
docker compose up -d
76+
KMS_ID="${KMS_ID}" docker compose run test pytest -s --junitxml=junit.xml --shard-id=${SHARD} --num-shards=10 \$JENKINS_FLAG ${params.PYTEST_PARAMS} || true
77+
docker compose down -v --remove-orphans
8378
curl -H "Content-Type:multipart/form-data" -H "Authorization: Bearer ${ZEPHYR_TOKEN}" -F "file=@junit.xml;type=application/xml" 'https://api.zephyrscale.smartbear.com/v2/automations/executions/junit?projectKey=PBM' -F 'testCycle={"name":"${JOB_NAME}-${BUILD_NUMBER}","customFields": { "PBM branch": "${PBM_BRANCH}","PSMDB docker image": "percona/percona-server-mongodb:${PSMDB}","instance": "${instance}"}};type=application/json' -i || true
8479
"""
8580
}

pbm/hetzner-pbm-functional-tests.groovy

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,12 @@ pipeline {
5353
docker kill \$(docker ps -a -q) || true
5454
docker rm \$(docker ps -a -q) || true
5555
docker rmi -f \$(docker images -q | uniq) || true
56+
docker system prune -f
5657
sudo rm -rf ./*
57-
58-
if [ ! -f "/usr/local/bin/docker-compose" ] ; then
59-
if [ ${params.instance} = "docker-aarch64" ]; then
60-
sudo curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-aarch64 -o /usr/local/bin/docker-compose
61-
else
62-
sudo curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
63-
fi
64-
sudo chmod +x /usr/local/bin/docker-compose
65-
fi
66-
6758
git clone https://github.com/Percona-QA/psmdb-testing
6859
cd psmdb-testing
6960
git checkout ${params.TESTING_BRANCH}
70-
61+
sudo apt install -y docker-compose-plugin
7162
cd pbm-functional/pytest
7263
cp $PBM_AWS_S3_YML ./conf/pbm/aws.yaml
7364
cp $PBM_GCS_S3_YML ./conf/pbm/gcs.yaml
@@ -76,10 +67,11 @@ pipeline {
7667
cp $PBM_MINIO_S3_YML ./conf/pbm/aws_minio.yaml
7768
cp $PBM_OSS_YML ./conf/pbm/oss.yaml
7869
if [ "${ADD_JENKINS_MARKED_TESTS}" = "true" ]; then JENKINS_FLAG="--jenkins"; else JENKINS_FLAG=""; fi
79-
docker-compose build
80-
docker-compose up -d
81-
KMS_ID="${KMS_ID}" docker-compose run test pytest -s --junitxml=junit.xml --shard-id=${SHARD} --num-shards=10 \$JENKINS_FLAG ${params.PYTEST_PARAMS} || true
82-
docker-compose down -v --remove-orphans
70+
docker compose build easyrsa
71+
docker compose build
72+
docker compose up -d
73+
KMS_ID="${KMS_ID}" docker compose run test pytest -s --junitxml=junit.xml --shard-id=${SHARD} --num-shards=10 \$JENKINS_FLAG ${params.PYTEST_PARAMS} || true
74+
docker compose down -v --remove-orphans
8375
curl -H "Content-Type:multipart/form-data" -H "Authorization: Bearer ${ZEPHYR_TOKEN}" -F "file=@junit.xml;type=application/xml" 'https://api.zephyrscale.smartbear.com/v2/automations/executions/junit?projectKey=PBM' -F 'testCycle={"name":"${JOB_NAME}-${BUILD_NUMBER}","customFields": { "PBM branch": "${PBM_BRANCH}","PSMDB docker image": "${PSMDB}","instance": "${instance}"}};type=application/json' -i || true
8476
"""
8577
}

pbm/pbm-functional-tests.groovy

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,14 @@ pipeline {
4545
docker rm \$(docker ps -a -q) || true
4646
docker rmi -f \$(docker images -q | uniq) || true
4747
sudo rm -rf ./*
48-
if [ ! -f "/usr/local/bin/docker-compose" ] ; then
49-
if [ ${params.instance} = "docker-64gb-aarch64" ]; then
50-
sudo curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-aarch64 -o /usr/local/bin/docker-compose
51-
else
52-
sudo curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
53-
fi
54-
sudo chmod +x /usr/local/bin/docker-compose
55-
fi
56-
5748
git clone https://github.com/Percona-QA/psmdb-testing
5849
cd psmdb-testing
5950
git checkout ${params.TESTING_BRANCH}
60-
6151
cd pbm-functional/pytest
62-
docker-compose build
63-
docker-compose up -d
64-
docker-compose run test pytest -s --junitxml=junit.xml --shard-id=${SHARD} --num-shards=10 -m 'not skip' || true
65-
docker-compose down -v --remove-orphans
52+
docker compose build
53+
docker compose up -d
54+
docker compose run test pytest -s --junitxml=junit.xml --shard-id=${SHARD} --num-shards=10 -m 'not skip' || true
55+
docker compose down -v --remove-orphans
6656
curl -H "Content-Type:multipart/form-data" -H "Authorization: Bearer ${ZEPHYR_TOKEN}" -F "file=@junit.xml;type=application/xml" 'https://api.zephyrscale.smartbear.com/v2/automations/executions/junit?projectKey=PBM' -F 'testCycle={"name":"${JOB_NAME}-${BUILD_NUMBER}","customFields": { "PBM branch": "${PBM_BRANCH}","PSMDB docker image": "${PSMDB}","instance": "${instance}"}};type=application/json' -i || true
6757
"""
6858
}

0 commit comments

Comments
 (0)