environment test

This commit is contained in:
crusader 2023-02-02 12:10:53 +00:00
parent f32138147c
commit 0df40cb78a

17
Jenkinsfile vendored
View File

@ -94,14 +94,15 @@ podTemplate(
serverUrl: env.K8s_SERVER_URL,
contextName: env.K8s_CONTEXT_NAME,
clusterName: env.K8s_CLUSTER_NAME]) {
sh """
DEPLOY_DATE=$(date +"%Y-%m-%d %H:%M:%S")
sed -i.bak 's#__REGISTRY_URL__#'"${dockerRegistryUrl}"'#' ./.k8s/deployment.yaml
sed -i.bak 's#__IMAGE_NAME__#'"${env.CONTAINER_IMAGE_NAME}"'#' ./.k8s/deployment.yaml
sed -i.bak 's#__IMAGE_TAG__#'"${env.PROJECT_VERSION}"'#' ./.k8s/deployment.yaml
sed -i.bak 's#__DEPLOY_DATE__#'"${DEPLOY_DATE}"'#' ./.k8s/deployment.yaml
kubectl apply -f ./.k8s/deployment.yaml
"""
println "CONTAINER_IMAGE_NAME - ${env.CONTAINER_IMAGE_NAME}"
// sh """
// DEPLOY_DATE=$(date +"%Y-%m-%d %H:%M:%S")
// sed -i.bak 's#__REGISTRY_URL__#'"${dockerRegistryUrl}"'#' ./.k8s/deployment.yaml
// sed -i.bak 's#__IMAGE_NAME__#'"${env.CONTAINER_IMAGE_NAME}"'#' ./.k8s/deployment.yaml
// sed -i.bak 's#__IMAGE_TAG__#'"${env.PROJECT_VERSION}"'#' ./.k8s/deployment.yaml
// sed -i.bak 's#__DEPLOY_DATE__#'"${DEPLOY_DATE}"'#' ./.k8s/deployment.yaml
// kubectl apply -f ./.k8s/deployment.yaml
// """
}
}
}