i have a dockerfile which is built with an ARG (name of the git branch). I want to run 2 if statements which test the name of the git branch: So if it is the test branch then it will run "npm run test", if it is master branch then "npm run build". I've tried this but it does not work :
RUN if [ "$GIT_BRANCH" = "test" ] ; then CMD npm test ; fi
RUN if [ "$GIT_BRANCH" = "master" ] ; then CMD npm build ; fi
It works with echo but not with npm commands. why ?
thank you