From 17364c3a79c2194262ca9d191858e913c5ed5ab9 Mon Sep 17 00:00:00 2001 From: ansgarz Date: Wed, 15 Dec 2021 13:19:26 +0100 Subject: [PATCH] further cleanup as merge preparation --- .gitlab-ci.yml | 26 ++++++------ .../docker-backup/image/resources/backup.sh | 1 - .../local-integration-test/setup-docker.sh | 41 ++----------------- 3 files changed, 16 insertions(+), 52 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a641999..ce8209f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ stages: - build_and_test - package - #- security + - security - upload - image - integrationtest @@ -96,17 +96,17 @@ package-uberjar: paths: - target/uberjar -#.sast: -# <<: *only-master -# variables: -# SAST_EXCLUDED_ANALYZERS: -# bandit, brakeman, flawfinder, gosec, kubesec, phpcs-security-audit, -# pmd-apex, security-code-scan, sobelow, spotbugs -# stage: security -# before_script: -# - mkdir -p builds && cp -r target/ builds/ -#include: -# - template: Security/SAST.gitlab-ci.yml +sast: + <<: *only-master + variables: + SAST_EXCLUDED_ANALYZERS: + bandit, brakeman, flawfinder, gosec, kubesec, phpcs-security-audit, + pmd-apex, security-code-scan, sobelow, spotbugs + stage: security + before_script: + - mkdir -p builds && cp -r target/ builds/ +include: + - template: Security/SAST.gitlab-ci.yml upload-clj-prerelease: <<: *clj @@ -154,8 +154,6 @@ backup-image-test-publish: nextcloud-integrationtest: stage: integrationtest - rules: - - if: '$CI_COMMIT_BRANCH == "integration-test-w-o-db-backup"' image: registry.gitlab.com/gitlab-org/cluster-integration/helm-install-image/releases/3.7.1-kube-1.20.11-alpine-3.14 services: - name: registry.gitlab.com/gitlab-org/cluster-integration/test-utils/k3s-gitlab-ci/releases/v1.22.2-k3s2 diff --git a/infrastructure/docker-backup/image/resources/backup.sh b/infrastructure/docker-backup/image/resources/backup.sh index 72b5414..9803839 100755 --- a/infrastructure/docker-backup/image/resources/backup.sh +++ b/infrastructure/docker-backup/image/resources/backup.sh @@ -15,7 +15,6 @@ function main() { backup-roles 'oc_' backup-db-dump - ls -l /var/backups/ backup-directory '/var/backups/' end-maintenance.sh diff --git a/src/test/resources/local-integration-test/setup-docker.sh b/src/test/resources/local-integration-test/setup-docker.sh index 877adaf..8727339 100755 --- a/src/test/resources/local-integration-test/setup-docker.sh +++ b/src/test/resources/local-integration-test/setup-docker.sh @@ -10,40 +10,26 @@ name='inttst' docker ps -#export timeout=30; while [ ! -f /var/lib/docker/volumes/k3s-server/_data/server/kubeconfig.yaml ]; do if [ "$timeout" == 0 ]; then echo "ERROR: Timeout while waiting for file."; docker ps -a; ls /var/lib/docker/volumes/k3s-server/_data/; break; fi; sleep 1; ((timeout--)); done export timeout=30; while ! docker exec $name sh -c "test -f /var/lib/rancher/k3s/server/kubeconfig.yaml"; do if [ "$timeout" == 0 ]; then echo "ERROR: Timeout while waiting for file."; break; fi; sleep 1; ((timeout--)); done - - -#sleep 60 - mkdir -p $HOME/.kube/ docker cp $name:/var/lib/rancher/k3s/server/kubeconfig.yaml $HOME/.kube/config -#docker cp $name:/var/lib/rancher/k3s/server/kubeconfig.yaml /var/lib/docker/volumes/k3s-server/_data/server/ -#ls /var/lib/docker/volumes/k3s-server/_data/server/ - -if [ "$timeout" == 0 ] +if [ "$timeout" == 0 ] then echo ------------------------------------------------------- find / -name "kubeconfig.yaml"; echo ------------------------------------------------------- docker ps -a echo ------------------------------------------------------- - exit -1 + exit 1 fi - echo "127.0.0.1 kubernetes" >> /etc/hosts -cat /etc/hosts -echo ---------------------------------- -cat $HOME/.kube/config - - -#cp /var/lib/docker/volumes/k3s-server/_data/server/kubeconfig.yaml $HOME/.kube/config apk add wget curl bash sudo openjdk8 + wget -P /etc/apk/keys/ https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub apk add --no-cache --repository=https://apkproxy.herokuapp.com/sgerrand/alpine-pkg-leiningen leiningen @@ -54,28 +40,9 @@ mv ./kubectl /usr/local/bin/kubectl sleep 20 #allow some time to startup k3s docker ps -a -swapoff -a -kubectl config view - -echo ======================================================== -kubectl --kubeconfig "$HOME/.kube/config" config view - -echo ======================================================== - -echo $KUBECONFIG +swapoff -a # can this be removed ? export KUBECONFIG=$HOME/.kube/config -kubectl config view - -echo ======================================================== - -sudo netstat -tlpn - -kubectl get pods - -echo ======================================================== pwd - -#cd /c4k-nextcloud/src/test/resources/local-integration-test && ./setup-local-s3-on-k3d.sh cd ./c4k-nextcloud/src/test/resources/local-integration-test && ./setup-local-s3-on-k3d.sh \ No newline at end of file