Skip to content

Commit 7104848

Browse files
authored
Merge pull request #109 from arangodb/log-artifcats
Archive log files
2 parents f4e3954 + bea1b0f commit 7104848

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.DS_Store
22
.gobuild
33
bin
4-
4+
logs

Jenkinsfile.groovy

+2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ def buildCleanupSteps(Map myParams, String kubeConfigRoot, String kubeconfig) {
101101
"DOCKERNAMESPACE=${myParams.DOCKERNAMESPACE}",
102102
"KUBECONFIG=${kubeConfigRoot}/${kubeconfig}",
103103
]) {
104+
sh "./scripts/collect_logs.sh ${env.DEPLOYMENTNAMESPACE} ${kubeconfig}"
105+
archive includes: 'logs/*'
104106
sh "make cleanup-tests"
105107
}
106108
}

Makefile

-3
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,6 @@ endif
261261
kubectl apply -f $(MANIFESTPATHTEST)
262262
$(ROOTDIR)/scripts/kube_create_storage.sh $(DEPLOYMENTNAMESPACE)
263263
$(ROOTDIR)/scripts/kube_run_tests.sh $(DEPLOYMENTNAMESPACE) $(TESTIMAGE) "$(ENTERPRISEIMAGE)" $(TESTTIMEOUT) $(TESTLENGTHOPTIONS)
264-
ifneq ($(DEPLOYMENTNAMESPACE), default)
265-
kubectl delete namespace $(DEPLOYMENTNAMESPACE) --ignore-not-found --now
266-
endif
267264

268265
.PHONY: cleanup-tests
269266
cleanup-tests:

scripts/collect_logs.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Collect logs from kube-arangodb operators
4+
5+
NS=$1
6+
POSTFIX=$2
7+
8+
if [ -z $NS ]; then
9+
echo "Specify a namespace argument"
10+
exit 1
11+
fi
12+
if [ -z $POSTFIX ]; then
13+
echo "Specify a postfix argument"
14+
exit 1
15+
fi
16+
17+
mkdir -p ./logs
18+
kubectl logs -n ${NS} --selector=name=arango-deployment-operator &> ./logs/deployment-${POSTFIX}.log
19+
kubectl logs -n kube-system --selector=name=arango-storage-operator &> ./logs/storage-${POSTFIX}.log

0 commit comments

Comments
 (0)