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

Added version to docker tag #542 #607

Merged
merged 4 commits into from Jan 23, 2020
Merged

Conversation

eddiewebb
Copy link
Contributor

@eddiewebb eddiewebb commented Jan 15, 2020

This change accesses the environment variable CIRCLE_TAG to address #542

Changes:

  1. Break docker push into its own job, runs only on tag creation
  2. Use machine executor for docker push job (a little faster since it avoids shipping docker context around)
  3. use the CIRCLE_TAG variable provided on tag builds

Options:

  1. We can merge jobs back AND/OR
  2. We can still publish SHA on master and just AMJOR/MINOR/PATCH, etc on tags

I ran in my own circle spae to test tagging. I obviously dont have your docker creds, so the push fails, but the tagging works.

Run:

#!/bin/bash -eo pipefail
docker tag mozilla/sops "mozilla/sops:$CIRCLE_SHA1"
# Update all semvers affected
echo "Tag mozilla/sops:$MAJOR"
docker tag mozilla/sops "mozilla/sops:$MAJOR"
echo "Tag mozilla/sops:$MAJOR.$MINOR"
docker tag mozilla/sops "mozilla/sops:$MAJOR.$MINOR"
echo "Tag mozilla/sops:$MAJOR.$MINOR.$PATCH"
docker tag mozilla/sops "mozilla/sops:$MAJOR.$MINOR.$PATCH"
docker images

Output

Tag mozilla/sops:0
Tag mozilla/sops:0.0
Tag mozilla/sops:0.0.5
REPOSITORY          TAG                                        IMAGE ID            CREATED                  SIZE
mozilla/sops        0                                          c533f52a658b        Less than a second ago   2.3GB
mozilla/sops        0.0                                        c533f52a658b        Less than a second ago   2.3GB
mozilla/sops        0.0.5                                      c533f52a658b        Less than a second ago   2.3GB
mozilla/sops        57f8a1fef66eb850dff6e43f06b1def877cff6af   c533f52a658b        Less than a second ago   2.3GB
mozilla/sops        latest                                     c533f52a658b        Less than a second ago   2.3GB
golang              1.12                                       8639ad3fc384        6 days ago               810MB

@codecov-io
Copy link

codecov-io commented Jan 15, 2020

Codecov Report

Merging #607 into develop will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #607      +/-   ##
===========================================
+ Coverage    37.11%   37.13%   +0.02%     
===========================================
  Files           21       21              
  Lines         2891     2892       +1     
===========================================
+ Hits          1073     1074       +1     
  Misses        1724     1724              
  Partials        94       94
Impacted Files Coverage Δ
config/config.go 71.64% <0%> (+0.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83a354e...19e44ab. Read the comment docs.

Copy link
Contributor

@ajvb ajvb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR @eddiewebb!

First thing, can you change this to be a PR against mozilla:develop rather than the master branch?

Second, I'm not a fan of using a semvar tool as it feels a bit heavy weight + I don't like pulling in some random code and running it. Can this be replaced with bash commands?

.circleci/config.yml Outdated Show resolved Hide resolved
@eddiewebb eddiewebb changed the base branch from master to develop January 18, 2020 13:13
This eliminates use of 3rd party tool but greatly simplifies supported versions.
MAJOR.MINOR.PTACH

Minor & Patch may be omitted ("v3", "v3.2", "v3.2.1")
@eddiewebb eddiewebb requested a review from ajvb January 19, 2020 21:45
@ajvb ajvb merged commit db9c552 into getsops:develop Jan 23, 2020
@ikedam ikedam mentioned this pull request Jan 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants