3030 GO_VERSION=$(shell cat ./GO_VERSION)
3131endif
3232
33+ VERSION =$(shell cat VERSION)
34+
3335export GO111MODULE =auto
3436
3537all : docker
@@ -390,7 +392,6 @@ get-deps-init:
390392 GO111MODULE=on go install honnef.co/go/tools/cmd/
[email protected] 391393
392394amazon-linux-sources.tgz :
393- ./scripts/update-version.sh
394395 cp packaging/amazon-linux-ami-integrated/ecs-agent.spec ecs-agent.spec
395396 cp packaging/amazon-linux-ami-integrated/ecs.conf ecs.conf
396397 cp packaging/amazon-linux-ami-integrated/ecs.service ecs.service
@@ -401,15 +402,14 @@ amazon-linux-sources.tgz:
401402
402403.amazon-linux-rpm-integrated-done : amazon-linux-sources.tgz
403404 test -e SOURCES || ln -s . SOURCES
404- rpmbuild --define " %_topdir $( PWD) " -bb ecs-agent.spec
405+ rpmbuild --define " %version ${VERSION} " --define " % _topdir $( PWD) " -bb ecs-agent.spec
405406 find RPMS/ -type f -exec cp {} . \;
406407 touch .amazon-linux-rpm-integrated-done
407408
408409amazon-linux-rpm-integrated : .amazon-linux-rpm-integrated-done
409410
410411# Make target for Amazon Linux Codebuild jobs
411412.amazon-linux-rpm-codebuild-done : get-cni-sources
412- ./scripts/update-version.sh
413413 cp packaging/amazon-linux-ami-integrated/ecs-agent.spec ecs-agent.spec
414414 cp packaging/amazon-linux-ami-integrated/ecs.conf ecs.conf
415415 cp packaging/amazon-linux-ami-integrated/ecs.service ecs.service
@@ -418,31 +418,27 @@ amazon-linux-rpm-integrated: .amazon-linux-rpm-integrated-done
418418 cp packaging/amazon-linux-ami-integrated/amazon-ecs-volume-plugin.socket amazon-ecs-volume-plugin.socket
419419 tar -czf ./sources.tgz ecs-init scripts misc agent amazon-ecs-cni-plugins amazon-vpc-cni-plugins agent-container Makefile VERSION GO_VERSION
420420 test -e SOURCES || ln -s . SOURCES
421- rpmbuild --define " %_topdir $( PWD) " -bb ecs-agent.spec
421+ rpmbuild --define " %version ${VERSION} " --define " % _topdir $( PWD) " -bb ecs-agent.spec
422422 find RPMS/ -type f -exec cp {} . \;
423423 touch .amazon-linux-rpm-codebuild-done
424424
425425amazon-linux-rpm-codebuild : .amazon-linux-rpm-codebuild-done
426426
427427.generic-rpm-integrated-done : get-cni-sources
428- ./scripts/update-version.sh
429428 cp packaging/generic-rpm-integrated/amazon-ecs-init.spec amazon-ecs-init.spec
430429 cp packaging/generic-rpm-integrated/ecs.service ecs.service
431430 cp packaging/generic-rpm-integrated/amazon-ecs-volume-plugin.service amazon-ecs-volume-plugin.service
432431 cp packaging/generic-rpm-integrated/amazon-ecs-volume-plugin.socket amazon-ecs-volume-plugin.socket
433432 tar -czf ./sources.tgz ecs-init scripts misc agent amazon-ecs-cni-plugins amazon-vpc-cni-plugins agent-container Makefile VERSION GO_VERSION
434433 test -e SOURCES || ln -s . SOURCES
435- rpmbuild --define " %_topdir $( PWD) " -bb amazon-ecs-init.spec
434+ rpmbuild --define " %version ${VERSION} " --define " % _topdir $( PWD) " -bb amazon-ecs-init.spec
436435 find RPMS/ -type f -exec cp {} . \;
437436 touch .generic-rpm-integrated-done
438437
439438# Build init rpm
440439generic-rpm-integrated : .generic-rpm-integrated-done
441440
442- VERSION = $(shell cat ecs-init/ECSVERSION)
443-
444441.generic-deb-integrated-done : get-cni-sources
445- ./scripts/update-version.sh
446442 mkdir -p BUILDROOT
447443 tar -czf ./amazon-ecs-init_${VERSION} .orig.tar.gz ecs-init scripts README.md
448444 cp -r packaging/generic-deb-integrated/debian Makefile ecs-init scripts misc agent agent-container amazon-ecs-cni-plugins amazon-vpc-cni-plugins README.md VERSION GO_VERSION BUILDROOT
0 commit comments