Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archive log files #109

Merged
merged 4 commits into from
Apr 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.DS_Store
.gobuild
bin

logs
2 changes: 2 additions & 0 deletions Jenkinsfile.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def buildCleanupSteps(Map myParams, String kubeConfigRoot, String kubeconfig) {
"DOCKERNAMESPACE=${myParams.DOCKERNAMESPACE}",
"KUBECONFIG=${kubeConfigRoot}/${kubeconfig}",
]) {
sh "./scripts/collect_logs.sh ${env.DEPLOYMENTNAMESPACE} ${kubeconfig}"
archive includes: 'logs/*'
sh "make cleanup-tests"
}
}
Expand Down
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,6 @@ endif
kubectl apply -f $(MANIFESTPATHTEST)
$(ROOTDIR)/scripts/kube_create_storage.sh $(DEPLOYMENTNAMESPACE)
$(ROOTDIR)/scripts/kube_run_tests.sh $(DEPLOYMENTNAMESPACE) $(TESTIMAGE) "$(ENTERPRISEIMAGE)" $(TESTTIMEOUT) $(TESTLENGTHOPTIONS)
ifneq ($(DEPLOYMENTNAMESPACE), default)
kubectl delete namespace $(DEPLOYMENTNAMESPACE) --ignore-not-found --now
endif

.PHONY: cleanup-tests
cleanup-tests:
Expand Down
19 changes: 19 additions & 0 deletions scripts/collect_logs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Collect logs from kube-arangodb operators

NS=$1
POSTFIX=$2

if [ -z $NS ]; then
echo "Specify a namespace argument"
exit 1
fi
if [ -z $POSTFIX ]; then
echo "Specify a postfix argument"
exit 1
fi

mkdir -p ./logs
kubectl logs -n ${NS} --selector=name=arango-deployment-operator &> ./logs/deployment-${POSTFIX}.log
kubectl logs -n kube-system --selector=name=arango-storage-operator &> ./logs/storage-${POSTFIX}.log