Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

static value 32 in Jenkinsfile (python-jenkins-agrocd-k8s) #72

Open
Ryzen-thor opened this issue Sep 2, 2023 · 0 comments
Open

static value 32 in Jenkinsfile (python-jenkins-agrocd-k8s) #72

Ryzen-thor opened this issue Sep 2, 2023 · 0 comments

Comments

@Ryzen-thor
Copy link

Hi Abhishek,

You have put static value 32 in Jenkinsfile at final stage ('Update K8S manifest & push to Repo').

But once whole build is successful and suppose we change some value in index.html file and rebuild the pipeline, the sed command will search for 32 value in deploy.yaml file. But its value would have been change to suppose 33 due to last build success and therefore build will fail.

Anyway we should not put static value while changing image. So instead of "sed -i '' "s/32/${BUILD_NUMBER}/g" deploy.yaml", we should write "sed -i '' "s/todo-app.*/todo-app:${BUILD_NUMBER}/g" deploy.yaml"

Here, since our app name is todo-app so we will do s/todo-app.*/todo-app:${BUILD_NUMBER}/g. I had a problem with this that's why I thought of putting dynamic value and it worked!😊

Should I request for PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant