Add jenkins charts
[it/dep.git] / smo-install / jenkins / gerrit / manual-stop-pipeline
1 podTemplate(yaml: '''
2               apiVersion: v1
3               kind: Pod
4               spec:
5                 containers:
6                 - name: jenkins-ubuntu
7                   image: ubuntu:20.04
8                   command:
9                   - sleep
10                   args: 
11                   - 99d
12 ''') {
13
14   node(POD_LABEL) {
15     def proxies=''
16     stage('Checkout') {
17       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
18     }
19       container('jenkins-ubuntu') {
20         stage ('Proxy settings') {
21           echo 'Proxy check'
22           script {
23             if (env.http_proxy) {
24               sh 'echo \'Acquire::http::Proxy "' + env.http_proxy + '";\' > /etc/apt/apt.conf.d/proxy.conf'
25               sh 'cat /etc/apt/apt.conf.d/proxy.conf'
26               sh 'echo "http_proxy = "'+env.http_proxy+' > ~/.wgetrc'
27               sh 'cat ~/.wgetrc'
28
29               sh 'echo \'Acquire::https::Proxy "' + env.http_proxy + '";\' >> /etc/apt/apt.conf.d/proxy.conf'
30               sh 'cat /etc/apt/apt.conf.d/proxy.conf'
31               sh 'echo "https_proxy = "'+env.http_proxy+' >> ~/.wgetrc'
32               sh 'cat ~/.wgetrc'
33
34               proxies='HTTPS_PROXY='+env.http_proxy+' '
35             }
36           }
37           sh 'printenv'
38         }
39
40         stage('Setup tools') {
41             sh 'apt-get update -y'
42             sh 'DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata'
43             sh 'apt-get install git wget sudo -y'
44             sh 'wget https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl'
45             sh 'mv kubectl /usr/bin'
46             sh 'chmod a+x /usr/bin/kubectl'
47             sh 'kubectl version'
48         }
49         stage('Stop SMO') {
50           sh './smo-install/scripts/sub-scripts/uninstall-nonrtric.sh'
51           sh './smo-install/scripts/sub-scripts/uninstall-onap.sh'
52         }
53
54       }
55     
56   }
57 }