Commit 33a9d251 authored by Manuel Kieweg's avatar Manuel Kieweg 🤷
Browse files

add docker image and token

parent cfd058d6
......@@ -10,17 +10,17 @@ import (
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/util/homedir"
"log"
"os"
"path/filepath"
)
func main() {
kubeconfig, err := clientcmd.BuildConfigFromFlags("", filepath.Join(homedir.HomeDir(), ".kube", "config"))
kubeconfig, err := clientcmd.BuildConfigFromFlags("https://api.ocp.fbi.h-da.de:6443", "")
if err != nil {
log.Fatal(err)
}
kubeconfig.Username = os.Getenv("K8S_DEPLOY_USER")
kubeconfig.BearerToken = os.Getenv("K8S_DEPLOY_TOKEN")
clientset, err := kubernetes.NewForConfig(kubeconfig)
if err != nil {
log.Fatal(err)
......
......@@ -9,6 +9,7 @@ build:
- ./k8s-bot
.deploy: &deploy
image: bitnami/kubectl:latest
variables:
K8S_OP: "create"
script:
......@@ -31,6 +32,7 @@ deploy:develop:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
destroy:
image: bitnami/kubectl:latest
stage: .post
variables:
K8S_OP: "delete"
......
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