Jenkinsfile 2.9 KB
Newer Older
Boris Baldassari's avatar
Boris Baldassari committed
1
2
3
4
5
6
pipeline {
  agent any
  options {
    buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '5'))
  }
  stages {
7
    stage('Setup AERI') {
Boris Baldassari's avatar
Boris Baldassari committed
8
9
      steps {
        sh '''
10
          cp /data/aeri/* website/content/aeri_stacktraces
Boris Baldassari's avatar
Boris Baldassari committed
11
12
13
        ''' 
      }
    }
14
    stage('Setup mboxes') {
15
16
      steps {
        sh '''
Boris Baldassari's avatar
Boris Baldassari committed
17
          ls /data/eclipse_mls/ > website/content/eclipse_mls/list_mboxes.txt
Boris Baldassari's avatar
Boris Baldassari committed
18
          cp /data/eclipse_mls_full.csv.gz website/content/eclipse_mls/eclipse_mls.csv.gz
19
          cp /data/eclipse_mls_full.csv website/content/eclipse_mls/eclipse_mls_full.csv
Boris Baldassari's avatar
Boris Baldassari committed
20
          cp -r /data/eclipse_mls_scrambled/ website/content/eclipse_mls/mboxes/
21
22
23
24
        ''' 
      }
    }

Boris Baldassari's avatar
Boris Baldassari committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
    stage('Build projects') {
      steps {
        sh '''
          pwd
          ls
          source ~/perl5/perlbrew/etc/bashrc 
          perlbrew switch perl-5.30.1
          perl -v 
          Rscript --version
          cd scripts/ && sh ./process_all_projects.sh
        ''' 
      }
    }
    stage('Build website') {
      steps {
        sh '''
          pwd
          ls
          source ~/perl5/perlbrew/etc/bashrc 
          Rscript --version
          echo "Building website."
          cd scripts/ && sh ./build_website.sh
          echo "Cleaning website zone from non-compressed files."
48
49
          find ../website/public/ -name "*.csv" | xargs rm -rf 
          find ../website/public/ -name "git*.txt" | xargs rm -rf 
50
51
52
53
54
55
        ''' 
      }
    }
    stage('Build download') {
      steps {
        sh '''
Boris Baldassari's avatar
Boris Baldassari committed
56
          echo "Creating download area."
57
          rsync -am --include='*.bz2' --include='*/' --exclude='*' website/public/ download/
Boris Baldassari's avatar
Boris Baldassari committed
58
          rsync -am --include='*.xz' --include='*/' --exclude='*' website/public/ download/
59
          rsync -am --include='*.gz' --include='*/' --exclude='*' website/public/ download/
Boris Baldassari's avatar
Boris Baldassari committed
60
          echo "Cleaning website zone from compressed files."
61
          find website/public/ -name "*.gz" -or -name "*.xz" -or -name "*.bz2" | xargs rm -rf 
Boris Baldassari's avatar
Boris Baldassari committed
62
63
64
65
66
67
68
69
70
71
72
73
74
75
        ''' 
      }
    }
    stage('Deploy Downloads') {
      steps {
        sh '''
          rsync -avz download/ bbaldassari2kd@projects-storage.eclipse.org:/home/data/httpd/download.eclipse.org/dataeggs/ --delete || echo "Error $?: some files/attrs were not transferred (see previous errors)"
        ''' 
      }
    }
    stage('Deploy Website') {
      steps {
        sh '''
          DATE=$(date +"%Y-%m-%d %T")
76
          rm -rf www/
77
78
          git clone ssh://bbaldassari2kd@git.eclipse.org:29418/www.eclipse.org/dataeggs.git www/
		  cd www/
79
          rm -rf *
80
          mv ../website/public/* .
81
          git add -A . 
Boris Baldassari's avatar
Boris Baldassari committed
82
          git commit -m "Publish web site $DATE."
83
          git push -u origin master
Boris Baldassari's avatar
Boris Baldassari committed
84
85
86
87
88
89
          
        ''' 
      }
    }
    stage('Archiving') {
      steps {
90
91
        archiveArtifacts artifacts: 'www/**/*.*', fingerprint: true 
        archiveArtifacts artifacts: 'download/**/*.*', fingerprint: true 
Boris Baldassari's avatar
Boris Baldassari committed
92
93
94
95
96
97
        cleanWs()
      }
    }
  }
}