Commit 5ae6cc5b authored by Manuel Kieweg's avatar Manuel Kieweg 🤷
Browse files

Merge branch 'nightly-builds' into 'master'

Nightly builds

See merge request cocsn/gosdn!137
parents 396a8547 6624403f
package main
import (
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
"context"
"os"
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
log "github.com/sirupsen/logrus"
appv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
......@@ -12,7 +14,6 @@ import (
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
"os"
)
func main() {
......@@ -28,7 +29,7 @@ func main() {
}
var tag string
switch os.Getenv("CI_COMMIT_BRANCH") {
case "master":
case os.Getenv("CI_DEFAULT_BRANCH"):
tag = "latest"
case "develop":
tag = "develop"
......@@ -36,6 +37,15 @@ func main() {
tag = os.Getenv("CI_COMMIT_SHA")
}
switch os.Getenv("CI_NIGHTLY") {
case "mainline":
tag = "nightly"
case "develop":
tag = "nightly-develop"
default:
tag = os.Getenv("CI_COMMIT_SHA")
}
switch os.Getenv("K8S_OP") {
case "create":
if err := create(clientset, tag); err != nil {
......
......@@ -50,7 +50,27 @@ deploy:latest:
- job: "build:k8s-bot"
artifacts: true
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_NIGHTLY == ""
deploy:nightly:mainline:
<<: *deploy
stage: deploy
needs:
- job: "build:latest"
- job: "build:k8s-bot"
artifacts: true
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_NIGHTLY == "mainline"
deploy:nightly:develop:
<<: *deploy
stage: deploy
needs:
- job: "build:latest"
- job: "build:k8s-bot"
artifacts: true
rules:
- if: $CI_COMMIT_BRANCH == "develop" && $CI_NIGHTLY == "mainline"
destroy:k8s:
image: bitnami/kubectl:latest
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment