-
Notifications
You must be signed in to change notification settings - Fork 619
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Derive version in agent, ecs-init, and .rpm/.deb packages fro…
…m the toplevel VERSION file #4423"; Update agent to 1.89.0
- Loading branch information
1 parent
1834778
commit 2aa7018
Showing
14 changed files
with
228 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,6 @@ else | |
GO_VERSION=$(shell cat ./GO_VERSION) | ||
endif | ||
|
||
VERSION=$(shell cat VERSION) | ||
|
||
export GO111MODULE=auto | ||
|
||
all: docker | ||
|
@@ -401,6 +399,7 @@ get-deps-init: | |
GO111MODULE=on go install honnef.co/go/tools/cmd/[email protected] | ||
|
||
amazon-linux-sources.tgz: | ||
./scripts/update-version.sh | ||
cp packaging/amazon-linux-ami-integrated/ecs-agent.spec ecs-agent.spec | ||
cp packaging/amazon-linux-ami-integrated/ecs.conf ecs.conf | ||
cp packaging/amazon-linux-ami-integrated/ecs.service ecs.service | ||
|
@@ -411,14 +410,15 @@ amazon-linux-sources.tgz: | |
|
||
.amazon-linux-rpm-integrated-done: amazon-linux-sources.tgz | ||
test -e SOURCES || ln -s . SOURCES | ||
rpmbuild --define "%version ${VERSION}" --define "%_topdir $(PWD)" -bb ecs-agent.spec | ||
rpmbuild --define "%_topdir $(PWD)" -bb ecs-agent.spec | ||
find RPMS/ -type f -exec cp {} . \; | ||
touch .amazon-linux-rpm-integrated-done | ||
|
||
amazon-linux-rpm-integrated: .amazon-linux-rpm-integrated-done | ||
|
||
# Make target for Amazon Linux Codebuild jobs | ||
.amazon-linux-rpm-codebuild-done: get-cni-sources | ||
./scripts/update-version.sh | ||
cp packaging/amazon-linux-ami-integrated/ecs-agent.spec ecs-agent.spec | ||
cp packaging/amazon-linux-ami-integrated/ecs.conf ecs.conf | ||
cp packaging/amazon-linux-ami-integrated/ecs.service ecs.service | ||
|
@@ -427,27 +427,31 @@ amazon-linux-rpm-integrated: .amazon-linux-rpm-integrated-done | |
cp packaging/amazon-linux-ami-integrated/amazon-ecs-volume-plugin.socket amazon-ecs-volume-plugin.socket | ||
tar -czf ./sources.tgz ecs-init scripts misc agent amazon-ecs-cni-plugins amazon-vpc-cni-plugins agent-container Makefile VERSION GO_VERSION | ||
test -e SOURCES || ln -s . SOURCES | ||
rpmbuild --define "%version ${VERSION}" --define "%_topdir $(PWD)" -bb ecs-agent.spec | ||
rpmbuild --define "%_topdir $(PWD)" -bb ecs-agent.spec | ||
find RPMS/ -type f -exec cp {} . \; | ||
touch .amazon-linux-rpm-codebuild-done | ||
|
||
amazon-linux-rpm-codebuild: .amazon-linux-rpm-codebuild-done | ||
|
||
.generic-rpm-integrated-done: get-cni-sources | ||
./scripts/update-version.sh | ||
cp packaging/generic-rpm-integrated/amazon-ecs-init.spec amazon-ecs-init.spec | ||
cp packaging/generic-rpm-integrated/ecs.service ecs.service | ||
cp packaging/generic-rpm-integrated/amazon-ecs-volume-plugin.service amazon-ecs-volume-plugin.service | ||
cp packaging/generic-rpm-integrated/amazon-ecs-volume-plugin.socket amazon-ecs-volume-plugin.socket | ||
tar -czf ./sources.tgz ecs-init scripts misc agent amazon-ecs-cni-plugins amazon-vpc-cni-plugins agent-container Makefile VERSION GO_VERSION | ||
test -e SOURCES || ln -s . SOURCES | ||
rpmbuild --define "%version ${VERSION}" --define "%_topdir $(PWD)" -bb amazon-ecs-init.spec | ||
rpmbuild --define "%_topdir $(PWD)" -bb amazon-ecs-init.spec | ||
find RPMS/ -type f -exec cp {} . \; | ||
touch .generic-rpm-integrated-done | ||
|
||
# Build init rpm | ||
generic-rpm-integrated: .generic-rpm-integrated-done | ||
|
||
VERSION = $(shell cat ecs-init/ECSVERSION) | ||
|
||
.generic-deb-integrated-done: get-cni-sources | ||
./scripts/update-version.sh | ||
mkdir -p BUILDROOT | ||
tar -czf ./amazon-ecs-init_${VERSION}.orig.tar.gz ecs-init scripts README.md | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.89.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
# Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the | ||
# "License"). You may not use this file except in compliance | ||
# with the License. A copy of the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0/ | ||
# | ||
# or in the "license" file accompanying this file. This file is | ||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR | ||
# CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and | ||
# limitations under the License. | ||
set -x | ||
set -e | ||
export TOPWD="$(pwd)" | ||
export BUILDDIR="$(mktemp -d)" | ||
export SRCPATH="${BUILDDIR}/src/github.com/aws/amazon-ecs-agent" | ||
export GITPATH="${BUILDDIR}/src/github.com/aws" | ||
export GO111MODULE="auto" | ||
|
||
if [ -d "${TOPWD}/.git" ]; then | ||
version=$(cat "${TOPWD}/ecs-init/ECSVERSION") | ||
git_hash=$(git rev-parse --short=8 HEAD) | ||
git_dirty=false | ||
|
||
if [[ "$(git status --porcelain)" != "" ]]; then | ||
git_dirty=true | ||
fi | ||
|
||
VERSION_FLAG="-X github.com/aws/amazon-ecs-agent/ecs-init/version.Version=${version}" | ||
GIT_HASH_FLAG="-X github.com/aws/amazon-ecs-agent/ecs-init/version.GitShortHash=${git_hash}" | ||
GIT_DIRTY_FLAG="-X github.com/aws/amazon-ecs-agent/ecs-init/version.GitDirty=${git_dirty}" | ||
fi | ||
|
||
# build cni-plugins | ||
mkdir -p "${GITPATH}" | ||
ls "${TOPWD}" | ||
ln -s "${TOPWD}/amazon-ecs-cni-plugins" "${GITPATH}" | ||
cd "${GITPATH}/amazon-ecs-cni-plugins" && make plugins | ||
mkdir -p ${SRCPATH}/misc/plugins && cp -a ./bin/plugins/. ${SRCPATH}/misc/plugins | ||
ls ${SRCPATH}/misc/plugins | ||
|
||
mkdir -p "{SRCPATH}" | ||
ln -s "${TOPWD}/amazon-ecs-volume-plugin" "${SRCPATH}" | ||
cd "${SRCPATH}" | ||
CGO_ENABLED=0 go build -x -ldflags "-s ${VERSION_FLAG} ${GIT_HASH_FLAG} ${GIT_DIRTY_FLAG}" \ | ||
-o "${SRCPATH}/amazon-ecs-volume-plugin" "${SRCPATH}/volumes/amazon-ecs-volume-plugin" | ||
rm -r "${BUILDDIR}" | ||
|
||
mkdir -p "${SRCPATH}" | ||
ln -s "${TOPWD}/ecs-init" "${SRCPATH}" | ||
cd "${SRCPATH}/ecs-init" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
version=${1:?Must specify version as the only argument (e.g. 1.0.0)} | ||
|
||
# Normalize to working directory being build root (up one level from ./scripts) | ||
ROOT=$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd ) | ||
cd "${ROOT}" | ||
|
||
echo -n "$version" > VERSION | ||
export ECS_UNKNOWN_VERSION=true | ||
|
||
cd ./agent/version/ | ||
# Turn off go module for version-gen.go - see scripts/build. | ||
GO111MODULE=off go run gen/version-gen.go | ||
cd "${ROOT}" | ||
|
||
git add agent/version/version.go VERSION | ||
|
||
# TODO, the changelog bump could also be automated | ||
echo "Please edit the changelog and commit the version bump" |
Oops, something went wrong.