corrected how environment variables are read
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
def call(String repoName, String repoUrl) {
|
||||
def call(String repoName) {
|
||||
def repoUrl = env.NEXUS_URL
|
||||
|
||||
container('helm') {
|
||||
sh "helm repo add ${repoName} ${repoUrl}"
|
||||
sh 'helm repo update'
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
def call(String releaseName, String chartRepo, String chartName, String version, String kubeApi, String kubeToken, String image, Map values = [:]) {
|
||||
def call(String releaseName, String chartRepo, String chartName, String version, String image, Map values = [:]) {
|
||||
def kubeApi = env.KUBERNETES_API
|
||||
def kubeToken = env.KUBERNETES_TOKEN
|
||||
|
||||
container('helm') {
|
||||
def helmCommand = "helm install ${releaseName} ${chartRepo}/${chartName} --version ${version} --kube-apiserver ${kubeApi} --kube-token ${kubeToken} --kube-insecure-skip-tls-verify --set image=${image}"
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
def call(String dockerRepo, String imageName, String dockerfilePath, String buildContext, String nexusUser, String nexusPass) {
|
||||
def call(String imageName, String dockerfilePath, String buildContext, String nexusUser) {
|
||||
def dockerRepo = env.NEXUS_DOCKER_URL
|
||||
def nexusPass = env.NEXUS_DOCKER_PASS
|
||||
|
||||
container('docker') {
|
||||
sh "dockerd --insecure-registry http://$NEXUS_DOCKER_URL &"
|
||||
sh "dockerd --insecure-registry http://${dockerRepo} &"
|
||||
echo "Started Docker daemon"
|
||||
sh "docker build -t ${imageName} -f ${dockerfilePath} ${buildContext}"
|
||||
echo "Docker image ${imageName} built"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
def call(String chartFile, String nexusUrl, String nexusUser, String nexusPass) {
|
||||
def call(String chartFile, String nexusUser, String nexusPass) {
|
||||
def nexusUrl = env.NEXUS_URL
|
||||
|
||||
container('maven') {
|
||||
sh "curl -u ${nexusUser}:${nexusPass} --upload-file ${chartFile} ${nexusUrl}"
|
||||
echo "Helm chart uploaded: ${chartFile} -> ${nexusUrl}"
|
||||
|
||||
Reference in New Issue
Block a user