#!/usr/bin/env groovy

/*  Copyright (c) 2019 AT&T Intellectual Property.                             #
#                                                                              #
#   Licensed under the Apache License, Version 2.0 (the "License");            #
#   you may not use this file except in compliance with the License.           #
#   You may obtain a copy of the License at                                    #
#                                                                              #
#       http://www.apache.org/licenses/LICENSE-2.0                             #
#                                                                              #
#   Unless required by applicable law or agreed to in writing, software        #
#   distributed under the License is distributed on an "AS IS" BASIS,          #
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
#   See the License for the specific language governing permissions and        #
#   limitations under the License.                                             #
##############################################################################*/


properties([[$class: 'ParametersDefinitionProperty', parameterDefinitions: [
    [$class: 'hudson.model.StringParameterDefinition', name: 'PHASE', defaultValue: "BUILD"],
    [$class: 'hudson.model.StringParameterDefinition', name: 'ENV', defaultValue: "dev"],
    [$class: 'hudson.model.StringParameterDefinition', name: 'MECHID', defaultValue: "m13591_otf_dev"],
    [$class: 'hudson.model.StringParameterDefinition', name: 'KUBE_CONFIG', defaultValue: "kubeConfig-dev"],
    [$class: 'hudson.model.StringParameterDefinition', name: 'TILLER_NAMESPACE', defaultValue: "com-att-ecomp-otf-dev"]
]]])


    echo "Build branch: ${env.BRANCH_NAME}"

    node("docker"){
      stage 'Checkout'
        checkout scm
        PHASES=PHASE.tokenize( '_' );
      echo "PHASES : " + PHASES


        ARTIFACT_ID="a1-sdnc-vth";
      VERSION="0.0.1-SNAPSHOT";
      NAMESPACE="com.att.ecomp.otf" //TODO change back to org-otf-oran when done testing
        DOCKER_REGISTRY="dockercentral.it.att.com:5100"

        if( ENV.equalsIgnoreCase("dev") ){
          IMAGE_NAME=DOCKER_REGISTRY + "/" + NAMESPACE + ".dev" + "/" + ARTIFACT_ID +  ":" + VERSION

        }
      if( ENV.equalsIgnoreCase("prod") || ENV.equalsIgnoreCase("prod-dr")){
        IMAGE_NAME=DOCKER_REGISTRY + "/" + NAMESPACE + ".prod" + "/" + ARTIFACT_ID +  ":" + VERSION

      }

      if( ENV.equalsIgnoreCase("st") ){
        IMAGE_NAME=DOCKER_REGISTRY + "/" + NAMESPACE + ".st" + "/" + ARTIFACT_ID +  ":" + VERSION

      }

      echo "Artifact: " + IMAGE_NAME

        withEnv(["PATH=${env.PATH}:${env.WORKSPACE}/linux-amd64", "HELM_HOME=${env.WORKSPACE}"]) {

          echo "PATH=${env.PATH}"
            echo "HELM_HOME=${env.HELM_HOME}"

            if (PHASES.contains("BUILD")){
              dir("./a1-sdnc-vth"){
                stage 'Publish Artifact'

                  withCredentials([usernamePassword(credentialsId: MECHID, usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {

                    echo "Artifact: " + IMAGE_NAME

                      sh """
                      docker login $DOCKER_REGISTRY --username $USERNAME --password $PASSWORD
                      docker build -t $IMAGE_NAME .
                      docker push $IMAGE_NAME
                      """
                  }
              }


            }

          if (PHASES.contains("DEPLOY") || PHASES.contains("UNDEPLOY")) {

            stage 'Init Helm'

              //check if helm exists if not install
              if(fileExists('linux-amd64/helm')){
                sh """
                  echo "helm is already installed"
                  """
              }
              else{
                //download helm
                sh """
                  echo "installing helm"
                  wget  https://storage.googleapis.com/kubernetes-helm/helm-v2.14.3-linux-amd64.tar.gz
                  tar -xf helm-v2.14.3-linux-amd64.tar.gz
                  rm helm-v2.14.3-linux-amd64.tar.gz
                  """
              }

            withCredentials([file(credentialsId: KUBE_CONFIG, variable: 'KUBECONFIG')]) {

              dir('a1-sdnc-vth/helm'){
                //check if charts are valid, and then perform dry run, if successful then upgrade/install charts

                if (PHASES.contains("UNDEPLOY") ) {
                  stage 'Undeploy'

                    sh """
                    helm delete --tiller-namespace=$TILLER_NAMESPACE --purge $ARTIFACT_ID
                    """
                }

                //NOTE Double quotes are used below to access groovy variables like artifact_id and tiller_namespace
                if (PHASES.contains("DEPLOY") ){
                  stage 'Deploy'
                    withCredentials([usernamePassword(credentialsId: MECHID, usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {

                      sh """
                        echo "Validate Yaml"
                        helm lint $ARTIFACT_ID

                        echo "View Helm Templates"
                        helm template $ARTIFACT_ID --set appName=$ARTIFACT_ID \
                        --set appName=$ARTIFACT_ID \
                        --set version=$VERSION  \
                        --set env=$ENV \
                        --set image=$IMAGE_NAME \
                        --set namespace=$TILLER_NAMESPACE

                        echo "Perform Dry Run Of Install"
                        helm upgrade --tiller-namespace=$TILLER_NAMESPACE --install --dry-run $ARTIFACT_ID $ARTIFACT_ID \
                        --set appName=$ARTIFACT_ID \
                        --set version=$VERSION  \
                        --set env=$ENV \
                        --set image=$IMAGE_NAME \
                        --set namespace=$TILLER_NAMESPACE


                        echo "Helm Install/Upgrade"
                        helm upgrade --tiller-namespace=$TILLER_NAMESPACE --install $ARTIFACT_ID $ARTIFACT_ID \
                        --set appName=$ARTIFACT_ID \
                        --set version=$VERSION  \
                        --set env=$ENV \
                        --set image=$IMAGE_NAME \
                        --set namespace=$TILLER_NAMESPACE

                        """
                    }
                }

              }
            }
          }

        }
    }
