I have set up a build of a node.js application on AWS. We create a dev environment, run tests against that. Then in the second stage, we build the production environment, if there was no failure in the first stage.
This takes a while, and I have come to realize that after the check out for the dev build, there is quite a bit of time for someone to save code before the production build starts, thus allowing untested code to get pushed to production. I thought that maybe I would not have to do a checkout for the second stage, that the checkout would still be there, but it failed on the first task, it couldn't find one of my scripts.
So I can make the second stage part of the first stage, that's easy enough - it's just going to have a lot of steps in it. But is there a way to not check the code out fresh? We are doing this on the cloud, and there is no way to specify revision number that I can see.
It would be best to tag the code upon successful build in the first step, then in the 2nd build (for production) would build from the tag or from the prior checkout. No need to checkout again if it succeeds.
In the first stage, make sure to compress the source code into a zip or tar file. Then set up a shared artifact see https://confluence.atlassian.com/display/BAMBOO/Bamboo+Best+Practice+-+Sharing+artifacts for more details on it.
Now you shouldn't have to worry about code slipping in as long as you have Bamboo doing the checkout (and not using git yourself). Bamboo will save the the revisions/sha's it's using and then reuse it for any downstream jobs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Daniel. I was wondering about whether it would save the revision. If I have multiple stages though, will it use the same revision in the second stage that it used in the first. I note that you said "jobs" and I don't know whether that means jobs in the next stage.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.