20 if (env.BRANCH_NAME.startsWith('PR-')) {
21 echo 'PULL REQUEST case detected'
22 gitInfo = checkout([$class: 'GitSCM', branches: [[name: 'pr/'+env.CHANGE_ID]], extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]], userRemoteConfigs: [[credentialsId: 'github_username_pass', name: 'origin', refspec: '+refs/pull/*/head:refs/remotes/origin/pr/*', url: 'https://github.com/sebdet/oran-deployment.git']]])
25 echo 'BRANCH case detected'
26 gitInfo = checkout([$class: 'GitSCM', branches: [[name: env.BRANCH_NAME]], extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]], userRemoteConfigs: [[credentialsId: 'github_username_pass', name: 'origin', refspec: '+refs/heads/*:refs/remotes/origin/*', url: 'https://github.com/sebdet/oran-deployment.git']]])
29 echo "Test: "+ gitInfo
30 githubNotify context:env.HUDSON_URL, description:'Validating SMO package', repo:'oran-deployment', account: 'sebdet', status:'PENDING', sha:gitInfo.GIT_COMMIT, credentialsId:'github_username_pass'
33 container('jenkins-ubuntu') {
34 stage ('Proxy settings') {
38 sh 'echo \'Acquire::http::Proxy "' + env.http_proxy + '";\' > /etc/apt/apt.conf.d/proxy.conf'
39 sh 'cat /etc/apt/apt.conf.d/proxy.conf'
40 sh 'echo "http_proxy = "'+env.http_proxy+' > ~/.wgetrc'
43 sh 'echo \'Acquire::https::Proxy "' + env.http_proxy + '";\' >> /etc/apt/apt.conf.d/proxy.conf'
44 sh 'cat /etc/apt/apt.conf.d/proxy.conf'
45 sh 'echo "https_proxy = "'+env.http_proxy+' >> ~/.wgetrc'
48 proxies='HTTPS_PROXY='+env.http_proxy+' '
54 stage('Setup tools') {
55 echo 'Setup container'
58 sh 'apt-get update -y'
59 sh 'DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata'
60 sh 'apt-get install git wget sudo -y'
62 sh 'wget https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl'
63 sh 'mv kubectl /usr/bin'
64 sh 'chmod a+x /usr/bin/kubectl'
66 sh proxies+' ./scripts/layer-0/0-setup-tests-env.sh'
67 sh proxies+' ./scripts/layer-0/0-setup-charts-museum.sh'
68 sh proxies+' ./scripts/layer-0/0-setup-helm3.sh'
71 stage('Build ONAP charts') {
72 sh proxies+' ./scripts/sub-scripts/build-onap.sh'
74 stage('Build ORAN charts') {
75 sh proxies+' ./scripts/sub-scripts/build-oran.sh'
77 stage('Build TESTS charts') {
78 sh proxies+' ./scripts/sub-scripts/build-tests.sh'
81 sh './scripts/layer-2/2-install-oran.sh pythonsdk-tests'
84 dir("test/pythonsdk") {
87 sh proxies+' NO_PROXY='+env.no_proxy+' tox'
91 githubNotify context:env.HUDSON_URL, description:'SMO Package build SUCCESSFUL', repo:'oran-deployment', account: 'sebdet', status:'SUCCESS', sha:gitInfo.GIT_COMMIT, credentialsId:'github_username_pass'
92 currentBuild.result = 'SUCCESS'
95 echo 'TOX tests crashed'
96 githubNotify context:env.HUDSON_URL, description:'SMO Package build FAILED, TOX tests crashed', repo:'oran-deployment', account: 'sebdet', status:'FAILURE', sha:gitInfo.GIT_COMMIT, credentialsId:'github_username_pass'
97 currentBuild.result = 'FAILURE'
102 sh './scripts/sub-scripts/uninstall-nonrtric.sh'
103 sh './scripts/sub-scripts/uninstall-onap.sh'
105 stage('Get Results') {
106 archiveArtifacts artifacts: 'test/pythonsdk/src/orantests/pythonsdk.debug.log, **/reports/junit/*.xml', fingerprint: true
107 junit '**/reports/junit/*.xml'