Add jenkins charts
[it/dep.git] / smo-install / jenkins / gerrit / manual-start-pipeline
1 lock('smo') {
2 podTemplate(yaml: '''
3               apiVersion: v1
4               kind: Pod
5               spec:
6                 containers:
7                 - name: jenkins-ubuntu
8                   image: ubuntu:20.04
9                   command:
10                   - sleep
11                   args: 
12                   - 99d
13 ''') {
14
15   node(POD_LABEL) {
16     def proxies=''
17     stage('Checkout') {
18       echo 'printenv'
19       checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: 'https://gerrit.o-ran-sc.org/r/it/dep']], branches: [[name: env.BRANCH]], extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]]], poll: false
20     }
21       container('jenkins-ubuntu') {
22         stage ('Proxy settings') {
23           echo 'Proxy check'
24           script {
25             if (env.http_proxy) {
26               sh 'echo \'Acquire::http::Proxy "' + env.http_proxy + '";\' > /etc/apt/apt.conf.d/proxy.conf'
27               sh 'cat /etc/apt/apt.conf.d/proxy.conf'
28               sh 'echo "http_proxy = "'+env.http_proxy+' > ~/.wgetrc'
29               sh 'cat ~/.wgetrc'
30
31               sh 'echo \'Acquire::https::Proxy "' + env.http_proxy + '";\' >> /etc/apt/apt.conf.d/proxy.conf'
32               sh 'cat /etc/apt/apt.conf.d/proxy.conf'
33               sh 'echo "https_proxy = "'+env.http_proxy+' >> ~/.wgetrc'
34               sh 'cat ~/.wgetrc'
35
36               proxies='HTTPS_PROXY='+env.http_proxy+' '
37             }
38           }
39           sh 'printenv'
40         }
41
42         stage('Setup tools') {
43             sh 'apt-get update -y'
44             sh 'DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata'
45             sh 'apt-get install git wget sudo -y'
46             sh 'wget https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl'
47             sh 'mv kubectl /usr/bin'
48             sh 'chmod a+x /usr/bin/kubectl'
49             sh 'kubectl version'
50             sh proxies+' ./smo-install/scripts/layer-0/0-setup-tests-env.sh'
51             sh proxies+' ./smo-install/scripts/layer-0/0-setup-charts-museum.sh'
52             sh proxies+' ./smo-install/scripts/layer-0/0-setup-helm3.sh'
53         }
54         stage('Build ONAP charts') {
55             sh proxies+' ./smo-install/scripts/sub-scripts/build-onap.sh'
56         }
57         stage('Build ORAN charts') {
58             sh proxies+' ./smo-install/scripts/sub-scripts/build-oran.sh'
59         }
60         stage('Build ONAP charts') {
61             sh proxies+' ./smo-install/scripts/sub-scripts/build-tests.sh'
62         }
63         stage('Start SMO') {
64             sh './smo-install/scripts/layer-2/2-install-oran.sh ' + env.FLAVOR
65         }
66       }
67     
68   }
69 }
70 }