Skip to content

Commit 0b2faae

Browse files
authored
Merge pull request #3 from couchbase-examples/DEVADV-1551_add-slack-notification
DEVADV-1551: adding slack reporting to kind-maven.yaml and maven.old
2 parents c93787f + 5476d31 commit 0b2faae

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

.github/workflows/kind-maven.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ jobs:
4141
helm repo add couchbase https://couchbase-partners.github.io/helm-charts/
4242
helm repo update
4343
helm install default --values deployment/operator-values.yaml couchbase/couchbase-operator
44-
- name: wait for cluster to come up
44+
- name: wait for cluster to come up
4545
run: |
46-
sleep 180
46+
sleep 180
4747
- name: set IPAddress and IpPort
4848
run: |
4949
echo "envIpAddress=$(kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type=="InternalIP")].address}')" >> $GITHUB_ENV
5050
echo "envIpPort=$(kubectl get svc default-couchbase-cluster-ui -o jsonpath='{.spec.ports[].nodePort}')" >> $GITHUB_ENV
51-
- name: combine to full connection string
51+
- name: combine to full connection string
5252
run: |
53-
echo "connectionString=$(echo "http://${envIpAddress}:${envIpPort}?network=external" | sed -e 's/[]$.*[\^]/\\&/g' )" | xargs >> $GITHUB_ENV
53+
echo "connectionString=$(echo "http://${envIpAddress}:${envIpPort}?network=external" | sed -e 's/[]$.*[\^]/\\&/g' )" | xargs >> $GITHUB_ENV
5454
- name: fix connection string
5555
run: |
5656
echo "${{ env.connectionString }}"
@@ -68,3 +68,15 @@ jobs:
6868

6969
- name: Run tests with Maven
7070
run: mvn -B test --file pom.xml
71+
- name: Report Status
72+
if: always()
73+
uses: ravsamhq/notify-slack-action@v1
74+
with:
75+
status: ${{ job.status }}
76+
notify_when: 'failure,warnings'
77+
notification_title: '{workflow} on *{repo}*'
78+
message_format: '{emoji} *{status_message}* in <{repo_url}|{repo}@{branch}> on <{commit_url}|{commit_sha}>'
79+
footer: '<{run_url}|View Full Run on GitHub>'
80+
env:
81+
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
82+

.github/workflows/maven.old

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,14 @@ jobs:
2323
distribution: 'adopt'
2424
- name: Build with Maven
2525
run: mvn -B package --file pom.xml
26+
- name: Report Status
27+
if: always()
28+
uses: ravsamhq/notify-slack-action@v1
29+
with:
30+
status: ${{ job.status }}
31+
notify_when: 'failure,warnings'
32+
notification_title: '{workflow} on *{repo}*'
33+
message_format: '{emoji} *{status_message}* in <{repo_url}|{repo}@{branch}> on <{commit_url}|{commit_sha}>'
34+
footer: '<{run_url}|View Full Run on GitHub>'
35+
env:
36+
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}

0 commit comments

Comments
 (0)