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

Extend --tag=branch which tags image with branch and sha #465

Merged
merged 1 commit into from
Jul 24, 2018

Conversation

martindekov
Copy link
Contributor

@martindekov martindekov commented Jul 24, 2018

With this commit the --tag is extended to include branch argument
which tags image not only with sha but branch-sha

Signed-off-by: Martin Dekov (VMware) mdekov@vmware.com

Extend the --tag with branch feature which tags image with branch and sha.

Description

Added checks to see the --tag argument if its branch it calls not only
GetGitSha, but also new function which checks the branch we are in.
If we are not in a repo it fails and if we are in a repo it gets the branch
and adds it to the image name name.

Motivation and Context

  • I have raised an issue to propose this change (required)

This references #463.

How Has This Been Tested?

Tested by building pushing and deploying image with my change.
Example pushed images are found in this docker hub repo:
https://hub.docker.com/r/martindekov/gofun/tags/
Adding image:<example name>:<example replacement of latest>
to check if latest will be appended in case the replacement exists.
Tried do build when not in a git repo with --tag=branch it returned error
2018/07/24 02:09:14 ERROR - Could not execute command: [docker build -t martindekov/gofun:0.2-fatal: not a git repository (or any of the parent directories): .git-fatal: not a git repository (or any of the parent directories): .git .]

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

With this commit the --tag is extended to include branch argument
which tags image not only with sha but branch-sha

Signed-off-by: Martin Dekov (VMware) <mdekov@vmware.com>
@alexellis
Copy link
Member

Derek set milestone: 0.6.16

@derek derek bot added this to the 0.6.16 milestone Jul 24, 2018
@alexellis
Copy link
Member

LGTM

@alexellis alexellis merged commit 767ae1d into openfaas:master Jul 24, 2018
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.

2 participants