From 04ff7299d6005f5f7cb6c5bfa2467791fabe46a7 Mon Sep 17 00:00:00 2001
From: Manuel Kieweg <manuel.kieweg@h-da.de>
Date: Wed, 14 Apr 2021 13:17:37 +0200
Subject: [PATCH] move go version to 1.16 and change check for absence of
 $CI_NIGHTLY

---
 Dockerfile                    | 2 +-
 build/ci/.build-container.yml | 4 ++--
 build/ci/.deploy-k8s.yml      | 4 ++--
 build/ci/.terraform-ci.yml    | 1 +
 build/ci/.test.yml            | 8 ++++++--
 5 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 12f1a3dd3..b8a7b9cab 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM golang:1.15-buster AS builder
+FROM golang:1.16-buster AS builder
 ARG GITLAB_USER
 ARG GITLAB_TOKEN
 ARG BUILDARGS
diff --git a/build/ci/.build-container.yml b/build/ci/.build-container.yml
index db5272edb..8a092f8a3 100644
--- a/build/ci/.build-container.yml
+++ b/build/ci/.build-container.yml
@@ -30,7 +30,7 @@ build:develop:
     TAG: $CI_REGISTRY_IMAGE:develop
     BUILDARGS: -race
   rules:
-    - if: $CI_COMMIT_BRANCH == "develop"
+    - if: $CI_COMMIT_BRANCH == "develop" && $CI_NIGHTLY == null
   <<: *build
 
 build:nightly:develop:
@@ -60,5 +60,5 @@ build:latest:
   variables:
     TAG: $CI_REGISTRY_IMAGE:latest
   rules:
-    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_NIGHTLY == null
   <<: *build
\ No newline at end of file
diff --git a/build/ci/.deploy-k8s.yml b/build/ci/.deploy-k8s.yml
index ad70cd4f4..7046b8e92 100644
--- a/build/ci/.deploy-k8s.yml
+++ b/build/ci/.deploy-k8s.yml
@@ -40,7 +40,7 @@ deploy:develop:
     - job: "build:k8s-bot"
       artifacts: true
   rules:
-    - if: $CI_COMMIT_BRANCH == "develop"
+    - if: $CI_COMMIT_BRANCH == "develop" && $CI_NIGHTLY == null
 
 deploy:latest:
   <<: *deploy
@@ -50,7 +50,7 @@ deploy:latest:
     - job: "build:k8s-bot"
       artifacts: true
   rules:
-    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_NIGHTLY == ""
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_NIGHTLY == null
 
 deploy:nightly:mainline:
   <<: *deploy
diff --git a/build/ci/.terraform-ci.yml b/build/ci/.terraform-ci.yml
index a3760e8eb..6049f9d3f 100644
--- a/build/ci/.terraform-ci.yml
+++ b/build/ci/.terraform-ci.yml
@@ -26,6 +26,7 @@ cache:
         TF_VAR_container_tag: $CI_REGISTRY_IMAGE:merge-request
     - if: $CI_COMMIT_BRANCH == "integration-test"
     - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
+    - if: $CI_NIGHTLY
 
 init:
   stage: .pre
diff --git a/build/ci/.test.yml b/build/ci/.test.yml
index 3ae62e0cd..225356ea6 100644
--- a/build/ci/.test.yml
+++ b/build/ci/.test.yml
@@ -1,5 +1,5 @@
 integration-test:
-  image: golang:1.14
+  image: golang:1.16
   stage: integration-test
   needs:
     - job: "apply"
@@ -8,6 +8,9 @@ integration-test:
     GOSDN_LOG: "nolog"
     GOSDN_TEST_API_ENDPOINT: http://gosdn-$CI_COMMIT_SHA.apps.ocp.fbi.h-da.de/api
   rules:
+    - if: $CI_NIGHTLY
+      when: delayed
+      start_in: 2 minutes
     - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
       when: delayed
       start_in: 2 minutes
@@ -19,13 +22,14 @@ integration-test:
     - go test -race ./test/integration -v -coverprofile=coverage.out
 
 .test: &test
-  image: golang:1.14
+  image: golang:1.16
   stage: test
   allow_failure: true
   variables:
     GOSDN_LOG: "nolog"
   rules:
     - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
+    - if: $CI_NIGHTLY
     - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
     - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
       allow_failure: true
-- 
GitLab