#!/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: "id_otf_dev"],
        [$class: 'hudson.model.StringParameterDefinition', name: 'KUBE_CONFIG', defaultValue: "kubeConfig-dev"],
        [$class: 'hudson.model.StringParameterDefinition', name: 'TILLER_NAMESPACE', defaultValue: "org-oran-otf"]
]]])


echo "Build branch: ${env.BRANCH_NAME}"

node("docker"){
	stage 'Checkout'
	checkout scm
	PHASES=PHASE.tokenize( '_' );
	echo "PHASES : " + PHASES


	ARTIFACT_ID="otf-ping-test-head";
	VERSION="Blitzcrank.1.1";
	NAMESPACE="org-oran-otf"
	DOCKER_REGISTRY="registry.hub.docker.io"

  if( ENV.equalsIgnoreCase("dev") ){
    IMAGE_NAME=DOCKER_REGISTRY + "/" + NAMESPACE + "/" + 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")){

			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.8.2-linux-amd64.tar.gz
					tar -xf helm-v2.8.2-linux-amd64.tar.gz
					rm helm-v2.8.2-linux-amd64.tar.gz
				"""
			}

			withCredentials([file(credentialsId: KUBE_CONFIG, variable: 'KUBECONFIG')]) {

				dir('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

								"""
							}
    	          	}

				}
			}
      	}

	}
}
