|
1 | 1 | #!/usr/bin/env groovy |
2 | | -pipeline { |
| 2 | +pipeline { |
3 | 3 | agent { |
4 | 4 | node { |
5 | | - label 'ssc-vm-g3-rhev4-1327' |
| 5 | + label 'sncr' |
6 | 6 | } |
7 | 7 | } |
8 | | - |
9 | | - parameters { |
10 | | - string(name: 'NODE_HOST', defaultValue: '', description: 'Node 1 Host FQDN', trim: true) |
11 | | - string(name: 'NODE_USER', defaultValue: '', description: 'Host machine root user', trim: true) |
12 | | - string(name: 'NODE_PASS', defaultValue: '', description: 'Host machine root user password', trim: true) |
13 | | - } |
14 | 8 |
|
15 | 9 | options { |
16 | 10 | timeout(time: 180, unit: 'MINUTES') |
17 | 11 | timestamps() |
18 | | - ansiColor('xterm') |
| 12 | + ansiColor('xterm') |
19 | 13 | buildDiscarder(logRotator(numToKeepStr: "30")) |
20 | 14 | } |
21 | 15 |
|
22 | | - environment { |
23 | | - NODE_PASS = "${NODE_PASS.isEmpty() ? NODE_DEFAULT_SSH_CRED_PSW : NODE_PASS}" |
24 | | - } |
25 | 16 |
|
26 | 17 | stages { |
27 | | - stage('Checkout') { |
28 | | - steps { |
29 | | - checkout([$class: 'GitSCM', branches: [[name: "main"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'PathRestriction', excludedRegions: '', includedRegions: 'scripts/third-party-rpm/.*']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'cortx-admin-github', url: "https://github.com/Seagate/cortx-motr"]]]) |
30 | | - } |
31 | | - } |
32 | | - stage ('Build rpm packages') { |
| 18 | + stage ('Create Single node cluster') { |
33 | 19 | steps { |
34 | 20 | script { build_stage = env.STAGE_NAME } |
35 | | - sh label: 'to build motr and hare rpm', script: ''' |
36 | | - sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} hostname |
37 | | - sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} git clone https://github.com/Seagate/cortx-motr |
38 | | - sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} "cd /root/cortx-motr ; /root/cortx-motr/scripts/build-prep-1node.sh -dev" |
39 | | - sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} "hctl bootstrap --mkfs singlenode.yaml" |
40 | | - sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} "dd if=/dev/urandom of=/tmp/128M bs=1M count=128" |
41 | | - sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} "/opt/seagate/cortx/hare/libexec/m0crate-io-conf > /root/crate.yaml" |
42 | | - sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} "/root/cortx-motr/utils/m0crate -S /root/crate.yaml" |
| 21 | + sh label: 'Download code and install single node cluster', script: ''' |
| 22 | + hostname |
| 23 | + pwd |
| 24 | + ln -s "$WORKSPACE" ../cortx-motr |
| 25 | + ./scripts/install/usr/libexec/cortx-motr/motr-cleanup || true |
| 26 | + losetup -D |
| 27 | + ./scripts/build-prep-1node.sh -dev |
| 28 | + hctl bootstrap --mkfs ../singlenode.yaml |
| 29 | + dd if=/dev/urandom of=/tmp/128M bs=1M count=128 |
| 30 | + /opt/seagate/cortx/hare/libexec/m0crate-io-conf > ./crate.yaml |
| 31 | + ./utils/m0crate -S ./crate.yaml |
43 | 32 | ''' |
44 | 33 | } |
45 | 34 | } |
46 | 35 | } |
47 | | - |
| 36 | + |
48 | 37 | post { |
49 | 38 | always { |
50 | 39 | script { |
51 | | - sh label: 'download_log_files', returnStdout: true, script: """ |
52 | | - sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} rm -rf /root/cortx-motr |
| 40 | + sh label: 'Clean up work space', returnStdout: true, script: """ |
| 41 | + pwd |
| 42 | + cd "$WORKSPACE" |
| 43 | + ./scripts/install/usr/libexec/cortx-motr/motr-cleanup || true |
| 44 | + losetup -D |
| 45 | + make uninstall || true |
| 46 | + cd ../cortx-hare |
| 47 | + make uninstall || true |
| 48 | + cd .. |
| 49 | + rm -rf cortx-hare cortx-motr |
| 50 | + echo Done |
53 | 51 | """ |
| 52 | + cleanWs() |
54 | 53 | } |
55 | 54 | } |
56 | 55 | } |
|
0 commit comments