You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: