Reducing the build/test steps in a PR/Merge scenario by leveraging artifacts?

Pure Krome's Avatar

Pure Krome

18 Dec, 2017 12:42 AM

Hi AV Team :)

we're looking at trying to optimize our buid/test/deploy times in various AV Projects we have.

A common thread for our CI/CD is the following:
- build - test - create artifact(s) - deploy if NOT a PR.

pretty common workflow.

Now, we if do a PR, we don't deploy. If we merge the PR, we do a deploy. But this is the kicker... we're also doing the build and tests again.

We just did that in the PR run .. and in that run, all was fine. So why bother doing it again ??

Notice how we create artifact(s) in our 4th step? also a common step ... so how about this?

  1. PR incoming.

    • build.
    • test
    • create and store artifact(s).
  2. PR is reviewed. all good. We merge the PR into master.

    • Artifact(s) is/are pulled down.
    • Deploy artifacts.

So we don't need to do the build/test steps cause that's just doubling up when we know they already work AND we already have an/some artifact(s).

So - is this possible? I'm guessing it might be by checking if an artifact(s) exist or something. I donno :(

cheers!

  1. Support Staff 1 Posted by Ilya Finkelshte... on 18 Dec, 2017 09:50 PM

    Ilya Finkelshteyn's Avatar

    Technically (puristically) speaking PR builds "virtual" merge and this is not the same bits which built after real merge. Simple because no guarantee that no changes can happen to code after PR build and merge.

    If you are OK with that, you can deploy PR build artifacts simple with Environment deployment (check this and this parts of docs). This kind of deployment was created with an idea to decouple deployment from build.

  2. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:25 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac