netdata/packaging: Add option for slack messages to be pushed on alternative channel, than the default. Push all info to #automation, make #ci-status error reporting only (#6268)
I 'll be monitoring closely the change - it is related to our CI and does not directly affect our customers
Paul Emm. Katsoulakis committed
Jun 12, 2019 at 11:11 UTC
08b0212bf975b2602506eab41d5d28d48a8268cf
2 files changed
+16
-9
.travis.yml
+9
-9
@@ -105,7 +105,7 @@ stages:
105
- sudo apt-get install -y wget lxc lxc-templates
106
- source tests/installer/slack.sh
107
before_script:
108
- - post_message "TRAVIS_MESSAGE" "Starting package preparation and publishing for ${BUILD_STRING}.${BUILD_ARCH}"
108
+ - post_message "TRAVIS_MESSAGE" "Starting package preparation and publishing for ${BUILD_STRING}.${BUILD_ARCH}" "automation"
109
- export PACKAGES_DIRECTORY="$(mktemp -d -t netdata-packaging-contents-dir-XXXXXX)" && echo "Created packaging directory ${PACKAGES_DIRECTORY}"
110
- export BUILD_VERSION=$(cat packaging/version | cut -d'-' -f1) # We always build on the latest release
111
script:
@@ -155,7 +155,7 @@ stages:
155
- sudo apt-get install -y wget lxc lxc-templates
156
- source tests/installer/slack.sh
157
before_script:
158
- - post_message "TRAVIS_MESSAGE" "Starting package preparation and publishing for ${BUILD_STRING}.${BUILD_ARCH}"
158
+ - post_message "TRAVIS_MESSAGE" "Starting package preparation and publishing for ${BUILD_STRING}.${BUILD_ARCH}" "automation"
159
- export PACKAGES_DIRECTORY="$(mktemp -d -t netdata-packaging-contents-dir-XXXXXX)" && echo "Created packaging directory ${PACKAGES_DIRECTORY}"
160
- export BUILD_VERSION=$(cat packaging/version | cut -d'-' -f1) # We always build on the latest release
161
script:
@@ -351,7 +351,7 @@ jobs:
351
- stage: Packaging for release
352
353
name: Generate changelog and TAG the release (only on special commit msg)
354
- before_script: post_message "TRAVIS_MESSAGE" "Packaging step for release initiated"
354
+ before_script: post_message "TRAVIS_MESSAGE" "Packaging step for release initiated" "automation"
355
script:
356
- echo "GIT Branch:" && git branch
357
- echo "Last commit:" && git log -1
@@ -537,7 +537,7 @@ jobs:
537
- stage: Publish for release
538
539
name: Build & Publish docker images
540
- before_script: post_message "TRAVIS_MESSAGE" "Publishing docker images"
540
+ before_script: post_message "TRAVIS_MESSAGE" "Publishing docker images" "automation"
541
script:
542
- echo "GIT Branch:" && git branch
543
- echo "Last commit:" && git log -1
@@ -554,7 +554,7 @@ jobs:
554
if: tag !~ /(-rc)/
555
556
- name: Create release draft
557
- before_script: post_message "TRAVIS_MESSAGE" "Drafting release on github"
557
+ before_script: post_message "TRAVIS_MESSAGE" "Drafting release on github" "automation"
558
script:
559
- echo "GIT Branch:" && git branch
560
- echo "Last commit:" && git log -1
@@ -575,7 +575,7 @@ jobs:
575
576
name: Run coverity scan
577
# Just notify people that Nightly ops triggered, use the first step as a hook to do that
578
- before_script: post_message "TRAVIS_MESSAGE" "Starting nightly operations"
578
+ before_script: post_message "TRAVIS_MESSAGE" "Starting nightly operations" "automation"
579
script: ./coverity-install.sh && ./coverity-scan.sh || echo "Coverity failed :("
580
581
- name: Kickstart files integrity testing (extended)
@@ -586,7 +586,7 @@ jobs:
586
587
# This is generating the changelog for nightly release and publish it
588
- name: Generate nightly changelog
589
- before_script: post_message "TRAVIS_MESSAGE" "Starting changelog generation for nightlies"
589
+ before_script: post_message "TRAVIS_MESSAGE" "Starting changelog generation for nightlies" "automation"
590
script: ".travis/nightlies.sh"
591
after_failure: post_message "TRAVIS_MESSAGE" "<!here> Nightly changelog generation failed"
592
git:
@@ -599,7 +599,7 @@ jobs:
599
- stage: Nightly release
600
601
name: Build & Publish docker images
602
- before_script: post_message "TRAVIS_MESSAGE" "Publishing docker images for nightlies"
602
+ before_script: post_message "TRAVIS_MESSAGE" "Publishing docker images for nightlies" "automation"
603
script:
604
- echo "GIT Branch:" && git branch
605
- echo "Last commit:" && git log -1
@@ -615,7 +615,7 @@ jobs:
615
env: ALLOW_SOFT_FAILURE_HERE=true
616
617
- name: Create nightly release artifacts, publish to GCS
618
- before_script: post_message "TRAVIS_MESSAGE" "Starting artifacts generation for nightlies"
618
+ before_script: post_message "TRAVIS_MESSAGE" "Starting artifacts generation for nightlies" "automation"
619
script:
620
- echo "GIT Branch:" && git branch
621
- echo "Last commit:" && git log -1
tests/installer/slack.sh
+7
@@ -13,6 +13,7 @@
13
post_message() {
14
TYPE="$1"
15
MESSAGE="$2"
16
+ CUSTOM_CHANNEL="$3"
17
18
case "$TYPE" in
19
"PLAIN_MESSAGE")
@@ -24,7 +25,13 @@ post_message() {
25
EVENT_LINE="${TRAVIS_JOB_NUMBER}: Event type '${TRAVIS_EVENT_TYPE}' #${TRAVIS_PULL_REQUEST}, on '${TRAVIS_OS_NAME}' "
26
fi
27
28
+ if [ -n "${CUSTOM_CHANNEL}" ]; then
29
+ echo "Sending travis message to custom channel ${CUSTOM_CHANNEL}"
30
+ OPTIONAL_CHANNEL_INFO="\"channel\": \"${CUSTOM_CHANNEL}\","
31
+ fi
32
+
33
POST_MESSAGE="{
34
+ ${OPTIONAL_CHANNEL_INFO}
35
\"text\": \"${TRAVIS_REPO_SLUG}, ${MESSAGE}\",
36
\"attachments\": [{
37
\"text\": \"${TRAVIS_JOB_NUMBER}: Event type '${TRAVIS_EVENT_TYPE}', on '${TRAVIS_OS_NAME}' \",