aws / amazon-ecs-init

Amazon Elastic Container Service RPM
http://aws.amazon.com/ecs
Apache License 2.0
200 stars 118 forks source link

packaging/generic-deb: use agent version from file instead of tag #395

Closed fenxiong closed 3 years ago

fenxiong commented 3 years ago

Summary

When we build a new version of ecs init package, the new agent version is available from file ecs-init/ECSVERSION, but not available from tag because the tag is created when we publish the release, but we build the package before that. This causes deb package build to use an agent version older than the release version.

Therefore, use the agent version from the ECSVERSION file instead of from git describe --tags.

Implementation details

Get agent version from cat ecs-init/ECSVERSION instead of from git describe --tags.

Testing

Built the deb package successfully. Verified that the version is read from file:

root@ip-172-31-12-102:/var/lib/ec2-stage/go/src/github.com/aws/amazon-ecs-init# make deb
./scripts/update-version.sh
++ dirname ./scripts/update-version.sh
+ CURRENTDIR=./scripts
++ cat ./scripts/../ecs-init/ECSVERSION
+ version=1.50.0
...

Description for the changelog

N/A

Licensing

This contribution is under the terms of the Apache 2.0 License: