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

Docker build from tagged branches #2858

Closed
aaronjudd opened this issue Sep 14, 2017 · 17 comments
Closed

Docker build from tagged branches #2858

aaronjudd opened this issue Sep 14, 2017 · 17 comments
Assignees
Labels
enhancement For issues that describe a feature that needs to be added, changed, or removed, but is not a bug

Comments

@aaronjudd
Copy link
Contributor

When creating a tagged release (commit to master, making a new release using GitHub) our CI workflow should automatically push the successful build to Docker Hub. I really don't think there is any need to have this logic be special to master or any other branch. Just any time we release/tag a branch we should build, push and label the image based on the tag name. This might not be great if we're pulling latest in production, but that's not something I'd suggest we/people rely on anyways.. ie using latest is akin to always living in alpha state.

@aaronjudd
Copy link
Contributor Author

Maybe this would also imply.. that we get rid of prequel?

@aaronjudd
Copy link
Contributor Author

CircleCI in theory should support tags now (Aug 1).

https://circleci.com/changelog/#circleci-2-0-git-tags-support

`CircleCI will not run a job for a Git tag unless a tags filter is specified.

https://circleci.com/docs/2.0/configuration-reference/#tags

@spencern
Copy link
Contributor

@jshimko any update here?

@jshimko
Copy link
Contributor

jshimko commented Sep 25, 2017

The short answer is we either need to make sure to add the version tag to the merge commit once it's on the master branch or we just manually build/push the image after the fact like I did last time. Either is an easy solution until I have time to refactor the CI config to use all of their new features.

The longer answer is I need to refactor the CI config to make use of Circle's new workflows feature (which supports parallel jobs, tag regex's, etc.). I have that partially finished on a local branch, but I'm trying to get unburied with other more pressing blockers before I go down that rabbit hole for half a day.

@spencern
Copy link
Contributor

spencern commented Oct 7, 2017

@aaronjudd is this a blocker for our 1.5.0 release still?

@brent-hoover brent-hoover added bug For issues that describe a defect or regression in the released software enhancement For issues that describe a feature that needs to be added, changed, or removed, but is not a bug and removed bug For issues that describe a defect or regression in the released software labels Nov 15, 2017
@aaronjudd
Copy link
Contributor Author

From @jshimko

Somebody needs to update the CircleCI config to support triggering builds on standalone tag push events. They didn’t support it at the time Circle 2.0 came out. It wouldn’t see the tags unless they were already on the commit when merged into master (which is never the case).
Our current solution ultimately came out of this discussion…
https://discuss.circleci.com/t/git-tag-deploys-in-2-0/9493
But they now officially support it.
https://circleci.com/docs/2.0/configuration-reference/#tags
The main hassle (and majority of the work) is we have to reformat things to use their “workflows” syntax.
https://circleci.com/docs/2.0/workflows/
It’s way more flexible, but it requires a bit of reading to use it properly. The main advantage I see is parallel job execution (as in tests can run at the same time as Docker builds, for example). That could potentially shave a lot of time off of our builds. That also allows you to only rerun specific steps. So you could rerun the Docker build without waiting 5+ mins for all of the test steps to finish again.
It’s all great, but somebody needs to put in the time to update our configs to use it. And time is something I haven’t had a surplus of for quite a while. 🙂

@aaronjudd
Copy link
Contributor Author

@impactmass Let's discuss, this might be a project you could take a look at...

@aldeed
Copy link
Contributor

aldeed commented Jan 12, 2018

I have set up / worked on a few apps using circle workflows. I am not yet up to speed on how the current reaction build is set up, but I might be of some minimal help if you get stuck on the workflows config

@impactmass impactmass self-assigned this Jan 22, 2018
@impactmass
Copy link
Contributor

impactmass commented Jan 24, 2018

Started working on this with help from @aldeed. Approach is to:

  • Update our current circleci config.yml to use the workflow in v2 (done)
  • Update the deploy job to use filters tag, to achieve this issue's goal
  • Update node image and fix issues
  • Test & PR

@aldeed
Copy link
Contributor

aldeed commented Jan 24, 2018

@aaronjudd @jshimko Can you think of any reason not to update the image for the "test" job to:

    docker:
      - image: circleci/node:8.9.1-browsers

The -browsers images have headless Chrome available for running client tests

@jshimko
Copy link
Contributor

jshimko commented Jan 24, 2018

That seems reasonable to me.

@spencern
Copy link
Contributor

spencern commented Feb 5, 2018

@impactmass FYI #3629 may help out with this ticket.

@spencern spencern mentioned this issue Feb 5, 2018
@impactmass
Copy link
Contributor

Thanks @spencern . #3629 actually solves the real problem of building from tagged branches.

So far, my work on #3618 will bring:

  1. the circleci config.yml to use workflows which enables:
    • faster builds by running jobs within a workflow independently (except when jobs depend on another)
    • faster re-runs by allowing individual re-runs on each job
  2. updates the test node image to a -browsers image that contains headless Chrome available for running client tests

I merged #3629 into #3618 and testing that everything works, then will open for review

@spencern
Copy link
Contributor

@impactmass @ticean what's our status here? Can this be closed?

@ticean
Copy link
Member

ticean commented Feb 28, 2018

Yep. This can be closed now. We're pushing all builds to Docker Hub.

@ticean ticean closed this as completed Feb 28, 2018
@aldeed
Copy link
Contributor

aldeed commented Mar 7, 2018

@ticean I had worked with @impactmass on converting to Circle workflows as part of this, and that still hasn't been merged. Is that tracked elsewhere? Also, more importantly, the config still is not running npm run lint command, which it should, so lint errors keep sneaking in. Should I make an issue for that, or make a PR?

@impactmass
Copy link
Contributor

impactmass commented Mar 7, 2018

@aldeed re: earlier work of updating the reaction repo to Circle workflows, it is being tracked in another issue. The plan is to have a similar Circle config across all our repos. So I'll be making some changes to the earlier work before it gets merged (PR should come in for that tomorrow).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For issues that describe a feature that needs to be added, changed, or removed, but is not a bug
Projects
None yet
Development

No branches or pull requests

7 participants