-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
AKS: 1.22.6
Docker image: jenkins/jenkins:2.319.3 (Helm proyect)
Plugins:
- kubernetes:1.31.1
- workflow-job:2.42
- workflow-cps:2.94.1
Good Days!
I try to export all pod templates in one repository but it's impossible.
I think that the Kubernetes plugin read only the files with jenkinsfiles. I can't change the directory.
My Problem:
ERROR: /var/jenkins_home/workspace/BACK-XXXX-BE-CICD-DEV/podtemplates/buildandeploy.yaml references a file that is not inside /var/jenkins_home/workspace/BACK-XXXX-BE-CICD-DEV@script/476260e2b89c89919685063f5e266301fa329b683e3e2dac05f5e7bd2c517b4e
My jenkinfile:
pipeline {
// VARIABLES TO ASSIGN
environment
agent any
stages {
stage('Checkout pod templates') {
steps {
dir ('podtemplates')
}
}
stage('Build Phase') {
agent {
kubernetes
}
steps {
//Backend
// Pull Resources
echo 'check out from gitlab Backend'
dir ('infra')
// Build as Image
echo 'Build Backend'
container('kaniko') {
script {
dir ('infra') {
sh '''
/kaniko/executor --context `pwd` \
--destination=registry.azurecr.io/${IMAGE_NAME_BACK}:${image_version}
'''
}
}
}
}
}
}
}
I change the directory for yamlFile, but it isn't working, It always searches in BACK-XXXX-BE-CICD-DEV@script but when I do "git clone", the directory is BACK-XXXX-BE-CICD-DEV.
Please, Are there some way for this?
I have a lot of pipelines and I need only the same pod template.
Thank you very much.
Regards.