-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new job configuration for GitLab CI integration
- Loading branch information
Showing
3 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
- project: | ||
name: samba_gitlab-fs-integration | ||
file_system: | ||
- 'cephfs' | ||
- 'cephfs.vfs' | ||
jobs: | ||
- 'samba_gitlab-{file_system}-integration' | ||
|
||
- job-template: | ||
name: 'samba_gitlab-{file_system}-integration' | ||
node: cico-workspace | ||
description: Run integrations for clustered Samba. | ||
project-type: freestyle | ||
concurrent: true | ||
|
||
parameters: | ||
- string: | ||
name: CENTOS_VERSION | ||
default: '9s' | ||
description: CentOS version to be installed on host node | ||
- string: | ||
name: FILE_SYSTEM | ||
default: '{file_system}' | ||
description: File system to be used as backend for Samba. | ||
|
||
scm: | ||
- git: | ||
url: https://github.com/samba-in-kubernetes/samba-centosci | ||
|
||
properties: | ||
- gitlab: | ||
connection: samba-upstream-gitlab | ||
|
||
- build-discarder: | ||
days-to-keep: 14 | ||
artifacts-days-to-keep: 14 | ||
|
||
triggers: | ||
- gitlab: | ||
trigger-push: false | ||
trigger-merge-request: false | ||
trigger-open-merge-request-push: source | ||
trigger-only-if-new-commits-pushed: true | ||
note-regex: '/(re)?run ((all)|(ci/({file_system})?))' | ||
ci-skip: false | ||
add-note-merge-request: false | ||
add-vote-merge-request: false | ||
merge-request-label-filter-config: | ||
include: ci/{file_system} | ||
|
||
builders: | ||
- shell: !include-raw-escape: scripts/common/get-node.sh | ||
- shell: | | ||
#!/bin/bash | ||
jobs/scripts/common/bootstrap.sh $WORKSPACE/jobs/scripts/gitlab-fs-integration/gitlab-fs-integration.sh "gitlabMergeRequestIid=$gitlabMergeRequestIid gitlabTargetRepoHttpUrl=$gitlabTargetRepoHttpUrl CENTOS_VERSION=$CENTOS_VERSION FILE_SYSTEM=$FILE_SYSTEM" | ||
publishers: | ||
- email-ext: | ||
recipients: $gitlabUserEmail | ||
reply-to: $DEFAULT_REPLYTO | ||
subject: $DEFAULT_SUBJECT | ||
content-type: text | ||
body: $DEFAULT_CONTENT | ||
attach-build-log: true | ||
- gitlab-notifier: | ||
name: ci/{file_system} | ||
- post-tasks: | ||
- matches: | ||
- log-text: Building remotely | ||
script: | ||
!include-raw-escape: | ||
- scripts/gitlab-fs-integration/copy.sh | ||
- scripts/common/return-node.sh | ||
- archive: | ||
artifacts: 'test.out, *.tar.gz' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "root@$(cat $WORKSPACE/hosts):/tmp/{test.out,*.tar.gz}" . |
69 changes: 69 additions & 0 deletions
69
jobs/scripts/gitlab-fs-integration/gitlab-fs-integration.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/bash | ||
|
||
# Set up a centos8 machine with the required environment to | ||
# run the tests from https://github.com/samba-in-kubernetes/sit-test-cases.git | ||
# and run the tests. | ||
|
||
BACKEND="${FILE_SYSTEM:-cephfs}" | ||
CENTOS_VERSION="${CENTOS_VERSION//[!0-9]}" | ||
TEST_EXTRA_VARS="" | ||
TEST_TARGET="test" | ||
|
||
set -e | ||
|
||
dnf -y install git | ||
|
||
rm -rf tests | ||
mkdir tests | ||
cd tests | ||
git clone --branch samba-git-install https://github.com/samba-in-kubernetes/sit-environment.git | ||
cd sit-environment | ||
|
||
cat << EOF > local.yml | ||
install: | ||
samba: | ||
git: | ||
repo: ${gitlabTargetRepoHttpUrl} | ||
mr: ${gitlabMergeRequestIid} | ||
EOF | ||
|
||
TEST_EXTRA_VARS="backend=${BACKEND}" | ||
|
||
dnf -y install epel-release epel-next-release | ||
|
||
dnf -y install make ansible-core | ||
|
||
if [ "${CENTOS_VERSION}" -eq 8 ]; then | ||
dnf -y install python3.12-pip | ||
dnf -y install ansible-collection-ansible-posix \ | ||
ansible-collection-ansible-utils | ||
pip3.12 install netaddr | ||
else | ||
dnf config-manager --set-enabled crb | ||
dnf -y install python3-pip | ||
ansible-galaxy collection install ansible.posix ansible.utils | ||
pip3 install netaddr | ||
fi | ||
|
||
dnf -y install qemu-kvm qemu-img libvirt libvirt-devel | ||
|
||
dnf -y copr enable pvalena/vagrant | ||
dnf -y install vagrant vagrant-libvirt rsync | ||
|
||
setfacl -m u:qemu:x /root/ | ||
|
||
systemctl start libvirtd | ||
|
||
set +e | ||
|
||
EXTRA_VARS="${TEST_EXTRA_VARS}" make "${TEST_TARGET}" | ||
ret=$? | ||
|
||
EXTRA_VARS="${TEST_EXTRA_VARS}" make statedump | ||
|
||
pushd /tmp | ||
find "sit_statedump" -name test.out -exec cp {} . \; | ||
tar -zcvf "sit_statedump.tar.gz" "sit_statedump" | ||
popd | ||
|
||
exit $ret |