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

Securely build and push Docker images #292

Merged
merged 2 commits into from
Jan 29, 2022
Merged

Conversation

AlekSi
Copy link
Member

@AlekSi AlekSi commented Jan 28, 2022

Refs #70.
Closes #224.

@AlekSi AlekSi added this to the v0.0.6 milestone Jan 28, 2022
@AlekSi AlekSi added the code/chore Code maintenance improvements label Jan 28, 2022
@AlekSi AlekSi requested a review from pboros January 28, 2022 18:28
@codecov
Copy link

codecov bot commented Jan 28, 2022

Codecov Report

Merging #292 (1249677) into main (2aca99a) will decrease coverage by 0.00%.
The diff coverage is 25.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #292      +/-   ##
==========================================
- Coverage   51.43%   51.42%   -0.01%     
==========================================
  Files         114      114              
  Lines        5448     5451       +3     
==========================================
+ Hits         2802     2803       +1     
- Misses       2229     2231       +2     
  Partials      417      417              
Impacted Files Coverage Δ
internal/util/version/version.go 35.48% <25.00%> (-0.24%) ⬇️

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 2aca99a...1249677. Read the comment docs.

# * We limit what third-party actions can be used.

# We also tried a different approach: build Docker image in one normal, secure `pull_request` workflow,
# upload artifact, and the download and publish in another workflow that has access to secrets, but treats
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
# upload artifact, and the download and publish in another workflow that has access to secrets, but treats
# upload artifact, and then download and publish it in another workflow that has access to secrets, but treats

Copy link
Contributor

@pboros pboros left a comment

Choose a reason for hiding this comment

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

Overall, looks good to me. Too bad importing the image didn't work. With that caveat, this is the best that can be done.

switch s.Key {
case "vcs.revision":
info.Commit = s.Value
if s.Value != info.Commit {
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the way that this ensures that the version info which is used for builds is consistent with git.

@AlekSi AlekSi merged commit ba7f06a into FerretDB:main Jan 29, 2022
@AlekSi AlekSi deleted the docker-build branch January 29, 2022 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/chore Code maintenance improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set more Docker image labels
2 participants