1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
|
dist: bionic
language: c
services:
- docker
# This is a hook to help us introduce "soft" errors on our process
matrix:
allow_failures:
- env: ALLOW_SOFT_FAILURE_HERE=true
# Install dependencies for all, once
#
install:
- sudo apt-get install -y libcap2-bin zlib1g-dev uuid-dev fakeroot libipmimonitoring-dev libmnl-dev libnetfilter-acct-dev gnupg python-pip
- sudo apt install -y --only-upgrade docker-ce
- sudo pip install git-semver==0.2.4 # 11/Sep/2019: git-semver tip was broken, so we had to force last good run of it
- docker info
- source tests/installer/slack.sh
- export NOTIF_CHANNEL="automation-beta"
- if [ "${TRAVIS_REPO_SLUG}" = "netdata/netdata" ]; then export NOTIF_CHANNEL="automation"; fi;
- export BUILD_VERSION="$(cat packaging/version | cut -d'-' -f1)"
- export LATEST_RELEASE_VERSION="$(cat packaging/version | cut -d'-' -f1)"
- export LATEST_RELEASE_DATE="$(git log -1 --format=%aD "${LATEST_RELEASE_VERSION}" | cat)"
- if [[ "${TRAVIS_COMMIT_MESSAGE}" = *"[Build latest]"* ]]; then export BUILD_VERSION="$(cat packaging/version | cut -d'-' -f1,2 | sed -e 's/-/./g').latest"; fi;
- export DEPLOY_REPO="netdata" # Default production packaging repository
- export PACKAGING_USER="netdata" # Standard package cloud account
- if [[ "${TRAVIS_COMMIT_MESSAGE}" = *"[Build latest]"* ]]; then export DEPLOY_REPO="netdata-edge"; fi;
- export PACKAGE_CLOUD_RETENTION_DAYS=30
- if [ ! "${TRAVIS_REPO_SLUG}" = "netdata/netdata" ]; then export DEPLOY_REPO="netdata-devel"; fi;
# These are release-related artifacts and have to be evaluated before we start doing conditional checks inside stages
- source ".travis/tagger.sh"
- export GIT_TAG="$(git tag --points-at)"
# Setup notification system
#
notifications:
webhooks: https://app.fossa.io/hooks/travisci
# Define the stage sequence and conditionals
#
stages:
# Mandatory runs, we always want these executed
- name: Code quality, linting, syntax, code style
- name: Build process
- name: Artifacts validation
- name: Artifacts validation on bare OS, stable to current lifecycle checks
if: branch = master AND (type = pull_request OR type = cron)
# Nightly operations
- name: Nightly operations
if: branch = master AND type = cron
- name: Nightly release
if: branch = master AND type = cron
# Scheduled releases
- name: Support activities on main branch
if: branch = master AND type != pull_request AND type != cron
- name: Publish for release
# We don't run on release candidates
if: branch = master AND type != pull_request AND type != cron AND commit_message =~ /\[netdata (release candidate|(major|minor|patch) release)\]/ AND tag !~ /(-rc)/
# Build DEB packages under special conditions
- name: Package ubuntu/* and debian/*
if: type != cron AND type != pull_request AND branch = master
# Build RPM packages under special conditions
- name: Package centos, fedora and opensuse
if: type != cron AND type != pull_request AND branch = master
# Define stage implementation details
#
jobs:
include:
# Do code quality, syntax checking and other pre-build activities
- stage: Code quality, linting, syntax, code style
name: Run shellchecking on BASH
script: shellcheck --format=gcc $(find . -name '*.sh.in' -not -iwholename '*.git*')
# This falls under same stage defined earlier
- name: Run checksum checks on kickstart files
script: ./tests/installer/checksums.sh
env: LOCAL_ONLY="true"
# This falls under same stage defined earlier
- name: Web Dashboard pre-generated file consistency checks (dashboard.js)
script: cp web/gui/dashboard.js /tmp/dashboard.js && ./build/build.sh && diff /tmp/dashboard.js web/gui/dashboard.js
# Ensure netdata code builds successfully
- stage: Build process
name: Standard netdata build
script: fakeroot ./netdata-installer.sh --install $HOME --dont-wait --dont-start-it --enable-plugin-nfacct --enable-plugin-freeipmi --disable-lto
env: CFLAGS='-O1 -DNETDATA_INTERNAL_CHECKS=1 -DNETDATA_VERIFY_LOCKS=1'
after_failure: post_message "TRAVIS_MESSAGE" "<!here> standard netdata build is failing (Still dont know which one, will improve soon)"
- name: Docker container build process (alpine installation)
script: packaging/docker/build.sh
env: DEVEL="true"
after_failure: post_message "TRAVIS_MESSAGE" "Docker build process failed"
- name: Run 'make dist' validation
before_script: mkdir /tmp/netdata-makedist-test
script:
- echo "GIT Branch:" && git branch
- echo "Last commit:" && git log -1
- echo "GIT Describe:" && git describe
- echo "packaging/version:" && cat packaging/version
- docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" make clean || echo "Nothing to clean"
- docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" make distclean || echo "Nothing to distclean"
- docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" /bin/bash -c "autoreconf -ivf && ./configure --prefix=/netdata_install/usr --sysconfdir=/netdata_install/etc --localstatedir=/netdata_install/var --with-zlib --with-math --with-user=netdata CFLAGS=-O2"
- docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" make dist
- docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" ls -ltr ./netdata-$(git describe).tar.gz || ls -ltr ./netdata-$(cat packaging/version | tr -d '\n').tar.gz
- .travis/run_install_with_dist_file.sh
- docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" make distclean
git:
depth: false
after_script: rm -rf /tmp/netdata-makedist-test
after_failure: post_message "TRAVIS_MESSAGE" "'make dist' failed"
- stage: Artifacts validation
name: Unit Testing
script:
- fakeroot ./netdata-installer.sh --install $HOME --dont-wait --dont-start-it --enable-plugin-nfacct --enable-plugin-freeipmi --disable-lto
- $HOME/netdata/usr/sbin/netdata -W unittest
env: CFLAGS='-O1 -DNETDATA_INTERNAL_CHECKS=1 -DNETDATA_VERIFY_LOCKS=1'
after_failure: post_message "TRAVIS_MESSAGE" "Unit testing failed"
- name: Build/install on ubuntu 14.04 (not containerized)
script: fakeroot ./netdata-installer.sh --dont-wait --dont-start-it --install $HOME
after_failure: post_message "TRAVIS_MESSAGE" "Build/Install failed on ubuntu 14.04"
- name: Build/Install for ubuntu 18.04 (not containerized)
script: fakeroot ./netdata-installer.sh --dont-wait --dont-start-it --install $HOME
after_failure: post_message "TRAVIS_MESSAGE" "Build/Install failed on ubuntu 18.04"
- name: Run netdata lifecycle, on ubuntu 18.04 (Containerized)
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "netdata/os-test:ubuntu1804" bats --tap tests/lifecycle.bats
after_failure: post_message "TRAVIS_MESSAGE" "Netdata lifecycle test script failed on ubuntu 18.04"
- name: Run netdata lifecycle from stable to current, on CentOS 7 (Containerized)
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "netdata/os-test:centos7" tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on CentOS 7"
- name: Build/install for CentOS 6 (Containerized)
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "netdata/os-test:centos6" ./netdata-installer.sh --dont-wait --dont-start-it --install /tmp
after_failure: post_message "TRAVIS_MESSAGE" "Build/Install failed on CentOS 6"
- name: Build/install for CentOS 7 (Containerized)
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "netdata/os-test:centos7" ./netdata-installer.sh --dont-wait --dont-start-it --install /tmp
after_failure: post_message "TRAVIS_MESSAGE" "Build/Install failed on CentOS 7"
- stage: "Artifacts validation on bare OS, stable to current lifecycle checks"
# Ubuntu runs
name: Run netdata lifecycle on Ubuntu 16.04 (xenial)
script: sudo -E tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Ubuntu 16.04"
# Ubuntu runs
- name: Run netdata lifecycle, on Ubuntu 18.04 (Containerized)
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "ubuntu:18.04" tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Ubuntu 18.04"
- name: Run netdata lifecycle, on Ubuntu 19.04 (Containerized)
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "ubuntu:19.04" tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Ubuntu 19.04"
# Centos runs
- name: Run netdata lifecycle on CentOS 6 (Containerized)
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "centos:6" tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare CentOS 6"
- name: Run netdata lifecycle on CentOS 7 (Containerized)
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "centos:7" tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare CentOS 7"
- name: Run netdata lifecycle, on Debian 9 (Containerized)
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "debian:stretch" tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Debian 9 (stretch)"
- name: Run netdata lifecycle, on Debian 10 (Containerized)
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "debian:buster" tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Debian 10 (buster)"
# openSuSE runs
- name: Run netdata lifecycle, on openSuSE 15.0
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "opensuse/leap:15.0" tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare opensuse/leap:15.0"
- name: Run netdata lifecycle, on openSuSE 15.1
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "opensuse/leap:15.1" tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare opensuse/leap:15.1"
- name: Run netdata lifecycle, on openSuSE Tumbleweed
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "opensuse/tumbleweed:latest" tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare opensuse/tumbleweed:latest"
# Alpine runs
- name: Run netdata lifecycle, on Alpine linux
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "alpine" tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Alpine"
# Arch linux runs
- name: Run netdata lifecycle, on ArchLinux
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "archlinux/base:latest" tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare archlinux/base:latest"
# Fedora runs
- name: Run netdata lifecycle, on Fedora 28
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "fedora:28" tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Fedora 28"
- name: Run netdata lifecycle, on Fedora 29
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "fedora:29" tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Fedora 29"
- name: Run netdata lifecycle, on Fedora 30 (Containerized)
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "fedora:30" tests/updater_checks.sh
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Fedora 30"
# - name: Run netdata lifecycle, on Fedora 31 (Containerized)
# script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "fedora:31" tests/updater_checks.sh
# after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Fedora 31"
- stage: Support activities on main branch
name: Run labeler on github issues
script: .travis/labeler.sh # labeler should be replaced with GitHub Actions when they hit GA
- name: Generate changelog for release (only on special and tagged commit msg)
before_script: post_message "TRAVIS_MESSAGE" "Support activities on main branch initiated" "${NOTIF_CHANNEL}"
script:
- echo "GIT Branch:" && git branch
- echo "Last commit:" && git log -1
- echo "GIT Describe:" && git describe
- echo "packaging/version:" && cat packaging/version
- if [[ -z "${GIT_TAG}" ]]; then echo "Running set tag for release" && set_tag_for_release; fi;
- .travis/generate_changelog_and_tag_release.sh
after_failure: post_message "TRAVIS_MESSAGE" "<!here> Changelog generation and tag of release, failed"
git:
depth: false
if: commit_message =~ /\[netdata (release candidate|(major|minor|patch) release)\]/ AND tag !~ /(-rc)/ OR (env(GIT_TAG) IS present AND NOT env(GIT_TAG) IS blank)
# ###### Packaging workflow section ######
# References:
# https://us.images.linuxcontainers.org
# https://packagecloud.io/docs#install_repo
# TODO: This section is stale, will be aligned with the RPM implementation when we get to DEB packaging
- stage: Package ubuntu/* and debian/*
_template: &DEB_TEMPLATE
git:
depth: false
before_install:
- sudo apt-get install -y wget lxc python3-lxc python-lxc lxc-templates dh-make git-buildpackage build-essential libdistro-info-perl
- source tests/installer/slack.sh
before_script:
- post_message "TRAVIS_MESSAGE" "Starting package preparation and publishing for ${BUILD_STRING}.${BUILD_ARCH}" "${NOTIF_CHANNEL}"
- export PACKAGES_DIRECTORY="$(mktemp -d -t netdata-packaging-contents-dir-XXXXXX)" && echo "Created packaging directory ${PACKAGES_DIRECTORY}"
script:
- echo "GIT Branch:" && git branch
- echo "Last commit:" && git log -1
- echo "GIT Describe:" && git describe
- echo "packaging/version:" && cat packaging/version
- echo "Creating LXC environment for the build" && sudo -E .travis/package_management/create_lxc_for_build.sh
- echo "Building package in container" && sudo -E .travis/package_management/build_package_in_container.sh
- sudo chown -R root:travis "/var/lib/lxc"
- sudo chmod -R 750 "/var/lib/lxc"
- echo "Preparing DEB packaging contents for upload" && sudo -E .travis/package_management/prepare_packages.sh
after_failure: post_message "TRAVIS_MESSAGE" "Failed to build DEB for ${BUILD_STRING}.${BUILD_ARCH}"
before_deploy:
- .travis/package_management/yank_stale_pkg.sh "${PACKAGES_DIRECTORY}" "${BUILD_STRING}" || echo "No stale DEB found"
deploy:
- provider: packagecloud
repository: "${DEPLOY_REPO}"
username: "${PACKAGING_USER}"
token: "${PKG_CLOUD_TOKEN}"
dist: "${BUILD_STRING}"
local_dir: "${PACKAGES_DIRECTORY}"
skip_cleanup: true
on:
# Only deploy on ${USER}/netdata, master branch, when build-area directory is created
repo: ${TRAVIS_REPO_SLUG}
branch: "master"
condition: -d "${PACKAGES_DIRECTORY}"
after_deploy:
- if [ -n "${BUILDER_NAME}" ]; then rm -rf /home/${BUILDER_NAME}/* && echo "Cleared /home/${BUILDER_NAME} directory" || echo "Failed to clean /home/${BUILDER_NAME} directory"; fi;
- if [ -d "${PACKAGES_DIRECTORY}" ]; then rm -rf "${PACKAGES_DIRECTORY}"; fi;
name: "Build & Publish DEB package for ubuntu/disco"
<<: *DEB_TEMPLATE
if: commit_message =~ /\[Package (amd64|arm64|i386) DEB( Ubuntu)?\]/
env:
- BUILDER_NAME="builder" BUILD_DISTRO="ubuntu" BUILD_RELEASE="disco" BUILD_STRING="ubuntu/disco"
- PACKAGE_TYPE="deb" REPO_TOOL="apt-get"
- ALLOW_SOFT_FAILURE_HERE=true
- name: "Build & Publish DEB package for ubuntu/cosmic"
<<: *DEB_TEMPLATE
if: commit_message =~ /\[Package (amd64|arm64|i386) DEB( Ubuntu)?\]/
env:
- BUILDER_NAME="builder" BUILD_DISTRO="ubuntu" BUILD_RELEASE="cosmic" BUILD_STRING="ubuntu/cosmic"
- PACKAGE_TYPE="deb" REPO_TOOL="apt-get"
- ALLOW_SOFT_FAILURE_HERE=true
- name: "Build & Publish DEB package for ubuntu/bionic"
<<: *DEB_TEMPLATE
if: commit_message =~ /\[Package (amd64|arm64|i386) DEB( Ubuntu)?\]/
env:
- BUILDER_NAME="builder" BUILD_DISTRO="ubuntu" BUILD_RELEASE="bionic" BUILD_STRING="ubuntu/bionic"
- PACKAGE_TYPE="deb" REPO_TOOL="apt-get"
- ALLOW_SOFT_FAILURE_HERE=true
- name: "Build & Publish DEB package for ubuntu/xenial"
<<: *DEB_TEMPLATE
if: commit_message =~ /\[Package (amd64|arm64|i386) DEB( Ubuntu)?\]/
env:
- BUILDER_NAME="builder" BUILD_DISTRO="ubuntu" BUILD_RELEASE="xenial" BUILD_STRING="ubuntu/xenial"
- PACKAGE_TYPE="deb" REPO_TOOL="apt-get"
- ALLOW_SOFT_FAILURE_HERE=true
- name: "Build & Publish DEB package for ubuntu/trusty"
<<: *DEB_TEMPLATE
if: commit_message =~ /\[Package (amd64|arm64|i386) DEB( Ubuntu)?\]/
env:
- BUILDER_NAME="builder" BUILD_DISTRO="ubuntu" BUILD_RELEASE="trusty" BUILD_STRING="ubuntu/trusty"
- PACKAGE_TYPE="deb" REPO_TOOL="apt-get"
- ALLOW_SOFT_FAILURE_HERE=true
- name: "Build & Publish DEB package for debian/buster"
<<: *DEB_TEMPLATE
if: commit_message =~ /\[Package (amd64|arm64|i386) DEB( Debian)?\]/
env:
- BUILDER_NAME="builder" BUILD_DISTRO="debian" BUILD_RELEASE="buster" BUILD_STRING="debian/buster"
- PACKAGE_TYPE="deb" REPO_TOOL="apt-get"
- ALLOW_SOFT_FAILURE_HERE=true
- name: "Build & Publish DEB package for debian/stretch"
<<: *DEB_TEMPLATE
if: commit_message =~ /\[Package (amd64|arm64|i386) DEB( Debian)?\]/
env:
- BUILDER_NAME="builder" BUILD_DISTRO="debian" BUILD_RELEASE="stretch" BUILD_STRING="debian/stretch"
- PACKAGE_TYPE="deb" REPO_TOOL="apt-get"
- ALLOW_SOFT_FAILURE_HERE=true
- name: "Build & Publish DEB package for debian/jessie"
<<: *DEB_TEMPLATE
if: commit_message =~ /\[Package (amd64|arm64|i386) DEB( Debian)?\]/
env:
- BUILDER_NAME="builder" BUILD_DISTRO="debian" BUILD_RELEASE="jessie" BUILD_STRING="debian/jessie"
- PACKAGE_TYPE="deb" REPO_TOOL="apt-get"
- ALLOW_SOFT_FAILURE_HERE=true
- stage: Package centos, fedora and opensuse
_template: &RPM_TEMPLATE
git:
depth: false
before_install:
- sudo apt-get install -y wget lxc lxc-templates python3-lxc python-lxc
- source tests/installer/slack.sh
before_script:
- post_message "TRAVIS_MESSAGE" "Starting package preparation and publishing for ${BUILD_STRING}.${BUILD_ARCH}" "${NOTIF_CHANNEL}"
- export PACKAGES_DIRECTORY="$(mktemp -d -t netdata-packaging-contents-dir-XXXXXX)" && echo "Created packaging directory ${PACKAGES_DIRECTORY}"
script:
- echo "GIT Branch:" && git branch
- echo "Last commit:" && git log -1
- echo "GIT Describe:" && git describe
- echo "packaging/version:" && cat packaging/version
- echo "Creating LXC environment for the build" && sudo -E .travis/package_management/create_lxc_for_build.sh
- echo "Building package in container" && sudo -E .travis/package_management/build_package_in_container.sh
- sudo chmod -R 755 "/var/lib/lxc"
- echo "Preparing RPM packaging contents for upload" && sudo -E .travis/package_management/prepare_packages.sh
after_failure: post_message "TRAVIS_MESSAGE" "Failed to build RPM for ${BUILD_STRING}.${BUILD_ARCH}"
before_deploy:
- .travis/package_management/yank_stale_pkg.sh "${PACKAGES_DIRECTORY}" "${BUILD_STRING}" || echo "No stale RPM found"
deploy:
- provider: packagecloud
repository: "${DEPLOY_REPO}"
username: "${PACKAGING_USER}"
token: "${PKG_CLOUD_TOKEN}"
dist: "${BUILD_STRING}"
local_dir: "${PACKAGES_DIRECTORY}"
skip_cleanup: true
on:
# Only deploy on ${USER}/netdata, master branch, when packages directory is created
repo: ${TRAVIS_REPO_SLUG}
branch: "master"
condition: -d "${PACKAGES_DIRECTORY}"
after_deploy:
- if [ -n "${BUILDER_NAME}" ]; then rm -rf /home/${BUILDER_NAME}/* && echo "Cleared /home/${BUILDER_NAME} directory" || echo "Failed to clean /home/${BUILDER_NAME} directory"; fi;
- if [ -d "${PACKAGES_DIRECTORY}" ]; then rm -rf "${PACKAGES_DIRECTORY}"; fi;
name: "Build & Publish RPM package for Enterprise Linux 6"
<<: *RPM_TEMPLATE
if: commit_message =~ /\[Package (amd64|arm64|i386) RPM( Enterprise Linux)?\]/
env:
- BUILDER_NAME="builder" BUILD_DISTRO="centos" BUILD_RELEASE="6" BUILD_STRING="el/6"
- PACKAGE_TYPE="rpm" REPO_TOOL="yum"
- ALLOW_SOFT_FAILURE_HERE=true
- name: "Build & Publish RPM package for Enterprise Linux 7"
<<: *RPM_TEMPLATE
if: commit_message =~ /\[Package (amd64|arm64) RPM( Enterprise Linux)?\]/
env:
- BUILDER_NAME="builder" BUILD_DISTRO="centos" BUILD_RELEASE="7" BUILD_STRING="el/7"
- PACKAGE_TYPE="rpm" REPO_TOOL="yum"
- ALLOW_SOFT_FAILURE_HERE=true
- name: "Build & Publish RPM package for Fedora 30"
<<: *RPM_TEMPLATE
if: commit_message =~ /\[Package (amd64|arm64) RPM( Fedora)?\]/
env:
- BUILDER_NAME="builder" BUILD_DISTRO="fedora" BUILD_RELEASE="30" BUILD_STRING="fedora/30"
- PACKAGE_TYPE="rpm" REPO_TOOL="dnf"
- ALLOW_SOFT_FAILURE_HERE=true
- name: "Build & Publish RPM package for Fedora 29"
<<: *RPM_TEMPLATE
if: commit_message =~ /\[Package (amd64|arm64) RPM( Fedora)?\]/
env:
- BUILDER_NAME="builder" BUILD_DISTRO="fedora" BUILD_RELEASE="29" BUILD_STRING="fedora/29"
- PACKAGE_TYPE="rpm" REPO_TOOL="dnf"
- ALLOW_SOFT_FAILURE_HERE=true
- name: "Build & Publish RPM package for OpenSuSE 15.1"
<<: *RPM_TEMPLATE
if: commit_message =~ /\[Package (amd64|arm64) RPM( openSuSE)?\]/
env:
- BUILDER_NAME="builder" BUILD_DISTRO="opensuse" BUILD_RELEASE="15.0" BUILD_STRING="opensuse/15.1"
- PACKAGE_TYPE="rpm" REPO_TOOL="zypper"
- ALLOW_SOFT_FAILURE_HERE=true
- name: "Build & Publish RPM package for OpenSuSE 15.0"
<<: *RPM_TEMPLATE
if: commit_message =~ /\[Package (amd64|arm64) RPM( openSuSE)?\]/
env:
- BUILDER_NAME="builder" BUILD_DISTRO="opensuse" BUILD_RELEASE="15.0" BUILD_STRING="opensuse/15.0"
- PACKAGE_TYPE="rpm" REPO_TOOL="zypper"
- ALLOW_SOFT_FAILURE_HERE=true
# ###### End of packaging workflow section ###### #
# ############################################### #
# We only publish if a TAG has been set during packaging
- stage: Publish for release
_template: &RELEASE_TEMPLATE
git:
depth: false
before_script: post_message "TRAVIS_MESSAGE" "Publishing docker images" "${NOTIF_CHANNEL}"
script:
- echo "GIT Branch:" && git branch
- echo "Last commit:" && git log -1
- echo "GIT Describe:" && git describe
- echo "packaging/version:" && cat packaging/version
- >-
packaging/docker/check_login.sh
&& echo "Switching to latest master branch, to pick up tagging if any" && git checkout master && git pull
&& packaging/docker/build.sh
&& packaging/docker/publish.sh
after_failure: post_message "TRAVIS_MESSAGE" "<!here> Docker image publishing failed"
name: Build & Publish docker image for i386
<<: *RELEASE_TEMPLATE
env:
- ALLOW_SOFT_FAILURE_HERE=true
- ARCHS=i386
- name: Build & Publish docker image for amd64
<<: *RELEASE_TEMPLATE
env:
- ALLOW_SOFT_FAILURE_HERE=true
- ARCHS=amd64
- name: Build & Publish docker image for armhf
<<: *RELEASE_TEMPLATE
env:
- ALLOW_SOFT_FAILURE_HERE=true
- ARCHS=armhf
- name: Build & Publish docker image for aarch64
<<: *RELEASE_TEMPLATE
env:
- ALLOW_SOFT_FAILURE_HERE=true
- ARCHS=aarch64
- name: Create release draft
git:
depth: false
before_script: post_message "TRAVIS_MESSAGE" "Drafting release on github" "${NOTIF_CHANNEL}"
script:
- echo "GIT Branch:" && git branch
- echo "Last commit:" && git log -1
- echo "GIT Describe:" && git describe
- echo "packaging/version:" && cat packaging/version
- echo "Generating release artifacts" && .travis/create_artifacts.sh # Could/should be a common storage to put this and share between jobs
- .travis/draft_release.sh
after_failure: post_message "TRAVIS_MESSAGE" "<!here> Draft release submission failed"
- name: Trigger .RPM and .DEB package generation
before_script: post_message "TRAVIS_MESSAGE" "Starting RPM and DEB package generation for release" "${NOTIF_CHANNEL}"
script:
- .travis/trigger_package_generation.sh
after_failure: post_message "TRAVIS_MESSAGE" "<!here> Stable release package generation produced errors" "${NOTIF_CHANNEL}"
git:
depth: false
# This is the nightly pre-execution step (Jobs, preparatory steps for nightly, etc)
- stage: Nightly operations
name: Run coverity scan
before_script:
- post_message "TRAVIS_MESSAGE" "Starting nightly operations" "${NOTIF_CHANNEL}"
- bash <(curl -sS https://raw.githubusercontent.com/netdata/netdata-demo-site/master/install-required-packages.sh) --dont-wait --non-interactive netdata
- sudo apt-get install -y libjson-c-dev libipmimonitoring-dev libcups2-dev libsnappy-dev libprotobuf-dev libprotoc-dev libssl-dev protobuf-compiler
script: ./coverity-scan.sh --with-install
after_failure: post_message "TRAVIS_MESSAGE" "<!here> Coverity nightly run has failed" "${NOTIF_CHANNEL}"
env:
- ALLOW_SOFT_FAILURE_HERE=true
- name: Kickstart files integrity testing (extended)
script: ./tests/installer/checksums.sh
- name: Run labeler on github issues
script: .travis/labeler.sh # labeler should be replaced with GitHub Actions when they hit GA
# This is generating the changelog for nightly release and publish it
- name: Generate nightly changelog
before_script: post_message "TRAVIS_MESSAGE" "Starting changelog generation for nightlies" "${NOTIF_CHANNEL}"
script:
- ".travis/nightlies.sh"
- ".travis/check_changelog_last_modification.sh"
after_failure: post_message "TRAVIS_MESSAGE" "<!here> Nightly changelog generation failed"
git:
depth: false
- name: Clean up package cloud nightly repository from old versions
before_script: post_message "TRAVIS_MESSAGE" "Starting package cloud repository clean up" "${NOTIF_CHANNEL}"
script:
- DEPLOY_REPO="netdata-edge" .travis/package_management/old_package_purging.sh
- DEPLOY_REPO="netdata-devel" .travis/package_management/old_package_purging.sh
# This is the nightly execution step
#
- stage: Nightly release
_template: &NIGHTLY_TEMPLATE
git:
depth: false
before_script: post_message "TRAVIS_MESSAGE" "Publishing docker images for nightlies" "${NOTIF_CHANNEL}"
script:
- echo "GIT Branch:" && git branch
- echo "Last commit:" && git log -1
- echo "GIT Describe:" && git describe
- echo "packaging/version:" && cat packaging/version
- docker info
- >-
packaging/docker/check_login.sh
&& packaging/docker/build.sh
&& packaging/docker/publish.sh
after_failure: post_message "TRAVIS_MESSAGE" "<!here> Nightly docker image publish failed"
name: Build & Publish docker image for i386
<<: *NIGHTLY_TEMPLATE
env:
- ALLOW_SOFT_FAILURE_HERE=true
- ARCHS=i386
- name: Build & Publish docker image for amd64
<<: *NIGHTLY_TEMPLATE
env:
- ALLOW_SOFT_FAILURE_HERE=true
- ARCHS=amd64
- name: Build & Publish docker image for armhf
<<: *NIGHTLY_TEMPLATE
env:
- ALLOW_SOFT_FAILURE_HERE=true
- ARCHS=armhf
- name: Build & Publish docker image for aarch64
<<: *NIGHTLY_TEMPLATE
env:
- ALLOW_SOFT_FAILURE_HERE=true
- ARCHS=aarch64
- name: Trigger .RPM and .DEB package generation
before_script: post_message "TRAVIS_MESSAGE" "Starting RPM and DEB package generation for nightlies" "${NOTIF_CHANNEL}"
script:
- .travis/trigger_package_generation.sh "[Build latest]"
after_failure: post_message "TRAVIS_MESSAGE" "<!here> Nightly package generation produced errors" "${NOTIF_CHANNEL}"
git:
depth: false
- name: Create nightly release artifacts, publish to GCS
before_script: post_message "TRAVIS_MESSAGE" "Starting artifacts generation for nightlies" "${NOTIF_CHANNEL}"
script:
- echo "GIT Branch:" && git branch
- echo "Last commit:" && git log -1
- echo "GIT Describe:" && git describe
- echo "packaging/version:" && cat packaging/version
- .travis/create_artifacts.sh
after_failure: post_message "TRAVIS_MESSAGE" "<!here> Nightly artifacts generation failed"
git:
depth: false
before_deploy:
echo "Preparing creds under ${TRAVIS_REPO_SLUG}";
if [ "${TRAVIS_REPO_SLUG}" == "netdata/netdata" ]; then
openssl aes-256-cbc -K $encrypted_8daf19481253_key -iv $encrypted_8daf19481253_iv -in .travis/gcs-credentials.json.enc -out .travis/gcs-credentials.json -d;
else
echo "Beta deployment stage in progress";
openssl aes-256-cbc -K $encrypted_8daf19481253_key -iv $encrypted_8daf19481253_iv -in .travis/gcs-credentials.json.enc -out .travis/gcs-credentials.json -d;
fi;
deploy:
# Beta storage, used for testing purposes
- provider: gcs
edge:
branch: gcs-ng
project_id: netdata-storage
credentials: .travis/gcs-credentials.json
bucket: "netdata-dev-nightlies"
skip_cleanup: true
local_dir: "artifacts"
on:
# Only deploy on netdata/netdata, master branch, when artifacts directory is created
repo: ${TRAVIS_REPO_SLUG}
branch: master
condition: -d "artifacts" && ${TRAVIS_REPO_SLUG} != "netdata/netdata"
# Production storage
- provider: gcs
edge:
branch: gcs-ng
project_id: netdata-storage
credentials: .travis/gcs-credentials.json
bucket: "netdata-nightlies"
skip_cleanup: true
local_dir: "artifacts"
on:
# Only deploy on netdata/netdata, master branch, when artifacts directory is created
repo: netdata/netdata
branch: master
condition: -d "artifacts" && ${TRAVIS_REPO_SLUG} = "netdata/netdata"
after_deploy: rm -f .travis/gcs-credentials.json
|