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

automatically publish v1.0.0-beta tag when publishing suffixed tag #85

Merged
merged 2 commits into from
Jun 29, 2020

Conversation

ryantate13
Copy link

I believe this should fix #82. Once out of beta the functionality will revert to the prior behavior, but the PUBLISH_TAGS logic could easily be changed to align with a v1.0.x track instead.

Output of make -n push post-change:

mkdir -p bin/darwin_amd64
mkdir -p .go/bin/darwin_amd64
mkdir -p .go/cache
echo "making bin/darwin_amd64/workerpodautoscaler"
docker run                                                 \
	    -i                                                      \
	    --rm                                                    \
	    -u $(id -u):$(id -g)                                  \
	    -v $(pwd):/src                                         \
	    -w /src                                                 \
	    -v $(pwd)/.go/bin/darwin_amd64:/go/bin                \
	    -v $(pwd)/.go/bin/darwin_amd64:/go/bin/darwin_amd64  \
	    -v $(pwd)/.go/cache:/.cache                            \
	    --env HTTP_PROXY=                          \
	    --env HTTPS_PROXY=                        \
	    golang:1.14.2-alpine                                          \
	    /bin/sh -c "                                            \
	        ARCH=amd64                                        \
	        OS=darwin                                            \
	        VERSION=v1.0.0-beta-59-gb1d9b7f-dirty                                  \
	        ./hack/build.sh                                    \
	    "
if ! cmp -s .go/bin/darwin_amd64/workerpodautoscaler bin/darwin_amd64/workerpodautoscaler; then \
	    mv .go/bin/darwin_amd64/workerpodautoscaler bin/darwin_amd64/workerpodautoscaler;            \
	    date >.go/bin/darwin_amd64/workerpodautoscaler.stamp;                              \
	fi
true
sed                                 \
	    -e 's|{ARG_BIN}|workerpodautoscaler|g'        \
	    -e 's|{ARG_ARCH}|amd64|g'      \
	    -e 's|{ARG_OS}|darwin|g'          \
	    -e 's|{ARG_FROM}|gcr.io/distroless/static|g' \
	    Dockerfile.in > .dockerfile-darwin_amd64
docker build  -t practodev/workerpodautoscaler:v1.0.0-beta-59-gb1d9b7f-dirty  -t practodev/workerpodautoscaler:v1.0.0-beta -f .dockerfile-darwin_amd64 .
docker images -q practodev/workerpodautoscaler:v1.0.0-beta-59-gb1d9b7f-dirty > .container-practodev_workerpodautoscaler-v1.0.0-beta-59-gb1d9b7f-dirty
docker push practodev/workerpodautoscaler:v1.0.0-beta-59-gb1d9b7f-dirty
docker push practodev/workerpodautoscaler:v1.0.0-beta
echo "pushed: practodev/workerpodautoscaler:v1.0.0-beta-59-gb1d9b7f-dirty"
echo "pushed: practodev/workerpodautoscaler:v1.0.0-beta"

@alok87 alok87 added the enhancement New feature or request label Jun 27, 2020
@alok87
Copy link
Contributor

alok87 commented Jun 27, 2020

Thanks, let me pull and test this in my local.

@alok87
Copy link
Contributor

alok87 commented Jun 27, 2020

@ryantate13 One issue with overwriting the same tag is, say I deployed today v1.0.0-beta in my cluster which was v1.0.0-beta-59-gb1d9b7f. Now after 10 days, my pod shifts to the new node. At that time v1.0.0-beta was overwritten and now is v1.0.0-beta-65-bg1d2b9d. The WPA will get updated for the user without him knowing it.

@ryantate13
Copy link
Author

That's true... Is that a bug, or a feature though? Similar to how mysql:8 is always 8.x? 🤔
Maybe rather than 1.0.0-beta which is somewhat deceptive we publish a tag that's 1.0-beta and the idea is that you always are on the 1.0.x track?

@alok87
Copy link
Contributor

alok87 commented Jun 28, 2020

👍 1.0-beta works

@ryantate13
Copy link
Author

I have a commit in place with the new behavior. Should I update README.md and artifacts/deployment-template.yaml to reflect the 1.0-beta tag?

@alok87
Copy link
Contributor

alok87 commented Jun 28, 2020

Yes, please do.
I will push the images after merging it. (this can also be offloaded to travis)

v1.0.x does not get automatically updated in the Github Releases. We are creating it manually after every new release. So for all the v1.0.x there wont be any release showing there at present.

Also you could contribute the same here https://github.com/thockin/go-build-template/blob/master/Makefile (not sure if it is required there but)

@alok87
Copy link
Contributor

alok87 commented Jun 29, 2020

Releasing v1 in sometime. So i will make the change then with v1 and not beta.

@alok87 alok87 merged commit 1202d83 into practo:master Jun 29, 2020
@alok87
Copy link
Contributor

alok87 commented Jun 29, 2020

@ryantate13 Made few changes for PUBLISH tags, please review it. 4de299b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Following the install guide, hack/install.sh attempts to deploy a non-existent tag
2 participants