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

- Adds initial templating support for build #159

Merged
merged 2 commits into from
Jul 9, 2018
Merged

- Adds initial templating support for build #159

merged 2 commits into from
Jul 9, 2018

Conversation

ehotinger
Copy link
Contributor

@ehotinger ehotinger commented Jul 9, 2018

Purpose of the PR:

  • Adds initial templating support for build
  • Fixes a bug in build where --pull wasn't being set
  • Removes {{.Build.Tag}} for now since it conflicts with --tag on build (and I'm not sure of its use case still)
$ acb build https://github.com/Azure/acr-builder.git -f Dockerfile -t "acr-builder:{{.Build.ID}}" -t 'acr-builder:{{now | date "20060102"}}' --id demo

...

Successfully tagged acr-builder:demo
Successfully tagged acr-builder:20180709

Fixes #139

- Fixes a bug in `build` where `--pull` wasn't being set
@SteveLasker
Copy link

The formatting required to get a common date is a bit complex.
can we enable now as a more first class primitive object?
.Build.Date would = 20180709-131422z which means (1:14:22pm UTC)

@ehotinger ehotinger mentioned this pull request Jul 9, 2018
@ehotinger
Copy link
Contributor Author

@SteveLasker LGTM. #161 for first classing and simplifying it

@@ -139,7 +137,6 @@ func TestOverrideValuesWithBuildInfo(t *testing.T) {
// Base properties
{"{{.Build.ID}}", expectedID},
{"{{.Build.Commit}}", expectedCommit},
{"{{ .Build.Tag }}", expectedTag},
{"{{ .Build.Repository}}", expectedRepo},
Copy link
Member

Choose a reason for hiding this comment

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

[](start = 6, length = 1)

extra space

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@northtyphoon this one's on purpose, to make sure we can render it correctly with arbitrary white spaces on the side

Copy link
Member

@northtyphoon northtyphoon left a comment

Choose a reason for hiding this comment

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

:shipit:

@ehotinger ehotinger merged commit a4e4bae into Azure:master Jul 9, 2018
@ehotinger ehotinger deleted the ehotinger/buildtemplate branch July 9, 2018 20:46
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

3 participants