.gitlab-ci.yml 6.64 KB
Newer Older
Mattias Ellert's avatar
Mattias Ellert committed
1 2
## Please do not change this file.
## Doing so will unfortunately create unnesseccary merge conflicts between branches and the fork, and nordugrid/arc version of this file.
Maiken's avatar
Maiken committed
3
## To have the automatic builds work on your fork, check that the runner is enabled in your fork: Settings->CI/CD->Runner settings
Maiken's avatar
Maiken committed
4

Maiken's avatar
Maiken committed
5
stages:
Maiken's avatar
Maiken committed
6
  - build
7
  - packages
8
  - deploy_and_test
Mattias Ellert's avatar
Mattias Ellert committed
9 10


11
fork_packages_el6:
Maiken's avatar
Maiken committed
12 13
  stage: build
  image: maikenp/arc-build-centos6
Mattias Ellert's avatar
Mattias Ellert committed
14
  script:
15
    - echo "master_$(date +%Y%m%dT%H%M%S)_${CI_COMMIT_SHA:0:8}" > VERSION
16 17 18 19 20
    - yum update -y
    - ./autogen.sh
    - ./configure
    - yum-builddep nordugrid-arc.spec -y
    - echo "Preparing and running rpmbuild"
Mattias Ellert's avatar
Mattias Ellert committed
21
    - mkdir -p rpmbuild/{SOURCES,BUILD,RPMS,SRPMS}
22
    - make dist
Mattias Ellert's avatar
Mattias Ellert committed
23 24
    - VERSION=`cat VERSION`
    - mv nordugrid-arc-${VERSION}.tar.gz rpmbuild/SOURCES
25
    - rpmbuild -D "_topdir $CI_PROJECT_DIR/rpmbuild" -ba nordugrid-arc.spec
Maiken's avatar
Maiken committed
26
  tags:
27
    - build-el6
Mattias Ellert's avatar
Mattias Ellert committed
28
  except:
29 30 31 32
    refs:
      - master
      - next-major
      - dev-ARC6
33 34
      - branches@nordugrid/arc
      - tags@nordugrid/arc
35 36 37 38 39 40 41
  artifacts:
    when: on_success
    expire_in: 3 days
    paths:
    - $CI_PROJECT_DIR/rpmbuild/SRPMS/
    - $CI_PROJECT_DIR/rpmbuild/RPMS/noarch/
    - $CI_PROJECT_DIR/rpmbuild/RPMS/x86_64/
42
  allow_failure: false
Mattias Ellert's avatar
Mattias Ellert committed
43 44


45
fork_packages_el7:
46 47
  stage: build
  image: maikenp/arc-build-centos7
Mattias Ellert's avatar
Mattias Ellert committed
48
  script:
49
    - echo "master_$(date +%Y%m%dT%H%M%S)_${CI_COMMIT_SHA:0:8}" > VERSION
50 51
    - yum update -y
    - ./autogen.sh
Mattias Ellert's avatar
Mattias Ellert committed
52
    - ./configure
53 54
    - yum-builddep nordugrid-arc.spec -y
    - echo "Preparing and running rpmbuild"
Mattias Ellert's avatar
Mattias Ellert committed
55
    - mkdir -p rpmbuild/{SOURCES,BUILD,RPMS,SRPMS}
56
    - make dist
Mattias Ellert's avatar
Mattias Ellert committed
57 58
    - VERSION=`cat VERSION`
    - mv nordugrid-arc-${VERSION}.tar.gz rpmbuild/SOURCES
59
    - rpmbuild -D "_topdir $CI_PROJECT_DIR/rpmbuild" -ba nordugrid-arc.spec
60
  tags:
61
    - build-el7
62 63 64 65 66 67 68 69
  artifacts:
    when: on_success
    expire_in: 3 days
    paths:
    - $CI_PROJECT_DIR/rpmbuild/SRPMS/
    - $CI_PROJECT_DIR/rpmbuild/RPMS/noarch/
    - $CI_PROJECT_DIR/rpmbuild/RPMS/x86_64/
  allow_failure: false
Mattias Ellert's avatar
Mattias Ellert committed
70
  except:
71 72
    refs:
      - master
73
      - next
74 75
      - branches@nordugrid/arc
      - tags@nordugrid/arc
Maiken's avatar
Maiken committed
76
  allow_failure: false
Mattias Ellert's avatar
Mattias Ellert committed
77 78


79
fork_packages_deb9:
80 81
  stage: build
  image: maikenp/arc-build-debian9
Mattias Ellert's avatar
Mattias Ellert committed
82
  script:
83
    - echo "master_$(date +%Y%m%dT%H%M%S)_${CI_COMMIT_SHA:0:8}" > VERSION
Mattias Ellert's avatar
Mattias Ellert committed
84 85 86 87 88 89 90 91 92 93 94 95
    - apt-get update -y
    - echo "6.0.0" > VERSION
    - ./autogen.sh
    - ./configure
    - make dist
    - VERSION=`cat VERSION`
    - mv nordugrid-arc-${VERSION}.tar.gz nordugrid-arc_${VERSION}.orig.tar.gz
    - tar -z -x -f nordugrid-arc_${VERSION}.orig.tar.gz
    - cd nordugrid-arc-${VERSION}
    - dpkg-buildpackage -S -us -uc -d
    - apt-get build-dep ../nordugrid-arc_${VERSION}-1.dsc -y
    - dpkg-buildpackage -b -us -uc
96 97
    - echo Delete dbgsym debs to save space
    - rm -f ../*-dbgsym_*.deb
98
  tags:
99
    - build-deb9
Mattias Ellert's avatar
Mattias Ellert committed
100
  except:
101 102
    refs:
      - master
103
      - next
104 105
      - branches@nordugrid/arc
      - tags@nordugrid/arc
106 107 108 109 110 111 112 113
  artifacts:
    when: on_success
    expire_in: 3 days
    paths:
    - $CI_PROJECT_DIR/*.orig.tar.gz
    - $CI_PROJECT_DIR/*.debian.tar.*
    - $CI_PROJECT_DIR/*.dsc
    - $CI_PROJECT_DIR/*.deb
114
  allow_failure: false
Mattias Ellert's avatar
Mattias Ellert committed
115

Maiken's avatar
Maiken committed
116

117
packages_deb9:
118
  stage: packages
119
  image: maikenp/arc-build-debian9
Mattias Ellert's avatar
Mattias Ellert committed
120
  script:
121
    - echo "master_$(date +%Y%m%dT%H%M%S)_${CI_COMMIT_SHA:0:8}" > VERSION
Mattias Ellert's avatar
Mattias Ellert committed
122 123 124 125 126 127 128 129 130 131 132
    - apt-get update -y
    - ./autogen.sh
    - ./configure
    - make dist
    - VERSION=`cat VERSION`
    - mv nordugrid-arc-${VERSION}.tar.gz nordugrid-arc_${VERSION}.orig.tar.gz
    - tar -z -x -f nordugrid-arc_${VERSION}.orig.tar.gz
    - cd nordugrid-arc-${VERSION}
    - dpkg-buildpackage -S -us -uc -d
    - apt-get build-dep ../nordugrid-arc_${VERSION}-1.dsc -y
    - dpkg-buildpackage -b -us -uc
133 134
    - echo Delete dbgsym debs to save space
    - rm -f ../*-dbgsym_*.deb
135
  tags:
Maiken's avatar
Maiken committed
136 137
    - 158.39.77.8
    - bgo-runner
Mattias Ellert's avatar
Mattias Ellert committed
138
  only:
139 140 141 142 143 144
    - branches@nordugrid/arc
    - tags@nordugrid/arc
  artifacts:
    when: on_success
    expire_in: 30 days
    paths:
Mattias Ellert's avatar
Mattias Ellert committed
145 146 147 148
    - $CI_PROJECT_DIR/*.orig.tar.gz
    - $CI_PROJECT_DIR/*.debian.tar.*
    - $CI_PROJECT_DIR/*.dsc
    - $CI_PROJECT_DIR/*.deb
149
  allow_failure: true
Mattias Ellert's avatar
Mattias Ellert committed
150

Maiken's avatar
Maiken committed
151

152
packages_el6:
153
  stage: packages
Maiken's avatar
Maiken committed
154
  image: maikenp/arc-build-centos6
Mattias Ellert's avatar
Mattias Ellert committed
155
  script:
156
    - echo "master_$(date +%Y%m%dT%H%M%S)_${CI_COMMIT_SHA:0:8}" > VERSION
Mattias Ellert's avatar
Mattias Ellert committed
157 158 159 160 161 162 163 164 165 166
    - yum update -y
    - ./autogen.sh
    - ./configure
    - yum-builddep nordugrid-arc.spec -y
    - echo "Preparing and running rpmbuild"
    - mkdir -p rpmbuild/{SOURCES,BUILD,RPMS,SRPMS}
    - make dist
    - VERSION=`cat VERSION`
    - mv nordugrid-arc-${VERSION}.tar.gz rpmbuild/SOURCES
    - rpmbuild -D "_topdir $CI_PROJECT_DIR/rpmbuild" -ba nordugrid-arc.spec
Maiken's avatar
Maiken committed
167
  tags:
Maiken's avatar
Maiken committed
168 169
    - 158.39.77.164
    - bgo-runner
Mattias Ellert's avatar
Mattias Ellert committed
170
  only:
Maiken's avatar
Maiken committed
171 172
    - branches@nordugrid/arc
    - tags@nordugrid/arc
Maiken's avatar
Maiken committed
173
  artifacts:
174
    when: on_success
Maiken's avatar
Maiken committed
175
    expire_in: 30 days
Maiken's avatar
Maiken committed
176 177 178 179
    paths:
    - $CI_PROJECT_DIR/rpmbuild/SRPMS/
    - $CI_PROJECT_DIR/rpmbuild/RPMS/noarch/
    - $CI_PROJECT_DIR/rpmbuild/RPMS/x86_64/
Maiken's avatar
Maiken committed
180
  allow_failure: false
Mattias Ellert's avatar
Mattias Ellert committed
181 182


183
packages_el7:
184
  stage: packages
185
  image: maikenp/arc-build-centos7
Mattias Ellert's avatar
Mattias Ellert committed
186
  script:
187
    - echo "master_$(date +%Y%m%dT%H%M%S)_${CI_COMMIT_SHA:0:8}" > VERSION
Mattias Ellert's avatar
Mattias Ellert committed
188 189 190 191 192 193 194
    - yum update -y
    - ./autogen.sh
    - ./configure
    - yum-builddep nordugrid-arc.spec -y
    - echo "Preparing and running rpmbuild"
    - mkdir -p rpmbuild/{SOURCES,BUILD,RPMS,SRPMS}
    - make dist
195
    - VERSION=`cat VERSION`
Mattias Ellert's avatar
Mattias Ellert committed
196 197
    - mv nordugrid-arc-${VERSION}.tar.gz rpmbuild/SOURCES
    - rpmbuild -D "_topdir $CI_PROJECT_DIR/rpmbuild" -ba nordugrid-arc.spec
198
  tags:
199
    - 158.39.77.235
Maiken's avatar
Maiken committed
200
    - bgo-runner
Mattias Ellert's avatar
Mattias Ellert committed
201
  only:
Maiken's avatar
Maiken committed
202 203
    - branches@nordugrid/arc
    - tags@nordugrid/arc
204 205
  artifacts:
    when: on_success
Maiken's avatar
Maiken committed
206
    expire_in: 30 days
207 208 209 210 211
    paths:
    - $CI_PROJECT_DIR/rpmbuild/SRPMS/
    - $CI_PROJECT_DIR/rpmbuild/RPMS/noarch/
    - $CI_PROJECT_DIR/rpmbuild/RPMS/x86_64/
  allow_failure: false
Mattias Ellert's avatar
Mattias Ellert committed
212

Maiken's avatar
Maiken committed
213

214 215
deploy_staging_el6:
  stage: deploy_and_test
216
  image: docker:stable
217
  script:
218
    - source /dockerrun.sh
219 220 221 222 223
  environment:
    name: staging
  artifacts:
    when: always
    paths:
224 225
     - /arc/arc-logs/
     - /arc/arc-tests/
Maiken's avatar
Maiken committed
226
  dependencies:
227
    - packages_el6
Maiken's avatar
Maiken committed
228
  tags:
229
    - docker-socket-runner-bgo4 
Mattias Ellert's avatar
Mattias Ellert committed
230
  only:
Maiken's avatar
Maiken committed
231 232 233
    - branches@nordugrid/arc
    - tags@nordugrid/arc
  allow_failure: true
Mattias Ellert's avatar
Mattias Ellert committed
234

Maiken's avatar
Maiken committed
235

236 237
deploy_staging_el7:
  stage: deploy_and_test
238
  image: docker:stable
239
  script:
240
    - source /dockerrun.sh
241 242 243 244 245
  environment:
    name: staging
  artifacts:
    when: always
    paths:
246 247
     - /arc/arc-logs/
     - /arc/arc-tests/
248
  dependencies:
249
    - packages_el7
250
  tags:
251
    - docker-socket-runner1
Mattias Ellert's avatar
Mattias Ellert committed
252
  only:
253 254 255 256
    - branches@nordugrid/arc
    - tags@nordugrid/arc
  allow_failure: true

257
## note-to-self: can also download the rpms from latest job with (example for el7):
258
    ## wget 'https://source.coderefinery.org/nordugrid/arc/-/jobs/artifacts/master/download?job=packages_el7' -O artifacts.zip