Skip to content
This repository was archived by the owner on Jun 22, 2021. It is now read-only.

Conversation

@zappy-shu
Copy link
Collaborator

Adds the code to run the initial build-push github actions including:

  • Login to docker registry server
  • Build, label, and tag an image including auto-tagging with branch/git-tag/pr-id/git-sha
  • Push to a docker registry

There are separate commands for login, build, and push as well as a single build-push command that does all 3 as required. This last command will be the one used by the docker/build-push-action

Adding functionality to read the common github actions variables and the
docker login variables.

Also adding the ability to run a `docker login` from the command

Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Adding build options along with generation of default tags and labels
based on git settings

Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Removing the GITHUB_RUN_ID and GITHUB_RUN_NUMBER as they do not allow
linking to the actual actions run easily

Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Adding build command to the binary. The command works by calling out to
the docker cli binary

Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Add ability to override both the path to the dockerfile and the path to
run the docker build from

Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Adds initial e2e framework including:
* Makefile test-e2e command
* Running in docker
* Login test with automated local registry setup and teardown

Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Creates the registry image to be used for e2e tests from a local
Dockerfile.registry so the path to the auth/htpasswd doesn't need to be
figured out at runtime

Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Adds push command and tests

Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
@zappy-shu zappy-shu changed the title DESKTOP-2412 Github action 1: Write first code to run the action [WIP] DESKTOP-2412 Github action 1: Write first code to run the action Feb 26, 2020

#### inputs

See the tagging section for information on tag inputs

Choose a reason for hiding this comment

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

Eventually we should make these links
See the [tagging section](https://github.com/docker/github-actions/README.md#Tagging)
or however that works

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Indeed. Will get round to it once the inputs and tags have been finalized

Signed-off-by: Nick Adcock <nick.adcock@docker.com>
@mikeparker
Copy link

I've reviewed the readme and some of the dockerfile but I'd like someone else to review the golang.

@mat007
Copy link

mat007 commented Feb 27, 2020

I've reviewed the readme and some of the dockerfile but I'd like someone else to review the golang.

I’ve been into the pinata CI today but I was planning on doing that as soon as possible.

Copy link

@mat007 mat007 left a comment

Choose a reason for hiding this comment

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

A lot of nits, a few questions.
Thanks!

Comment on lines +80 to +82
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
Copy link

Choose a reason for hiding this comment

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

nit: I personally find it’s easier to read and less convoluted to just use a function to factor the test code and call it multiple times, one for each test case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is how I've seen and been doing it within app-def/dev-tooling repos so I've been following that standard.

Split auto-tagging to enable tagging with sha and tagging with ref
separately. The action definition will handle the default settings.

Also rename SetDefaultLabels to AddGitLabels

Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
@zappy-shu zappy-shu requested a review from mat007 March 4, 2020 11:21
@zappy-shu zappy-shu changed the title [WIP] DESKTOP-2412 Github action 1: Write first code to run the action DESKTOP-2412 Github action 1: Write first code to run the action Mar 4, 2020
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Returns an error when boolean inputs are invalid:
- tag_with_ref
- tag_with_sha
- push

If the inputs are not set then defaults to false

Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
@zappy-shu zappy-shu merged commit 20414ad into master Mar 4, 2020
@zappy-shu zappy-shu deleted the spike-first-action branch March 5, 2020 16:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants