From 01c437214b7112a05caf0d033843c96537f6829f Mon Sep 17 00:00:00 2001 From: Ray Allan Date: Tue, 16 Aug 2022 15:19:42 +0000 Subject: [PATCH] Update short hash and add init release version; add healthcheck and expose required ports --- agent-container/agent-config.json | 2 +- buildspecs/merge-build.yml | 2 +- buildspecs/release-config.yml | 4 ++++ scripts/verify-agent-artifacts | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/agent-container/agent-config.json b/agent-container/agent-config.json index fc3f1ed1492..316cc5a9d70 100644 --- a/agent-container/agent-config.json +++ b/agent-container/agent-config.json @@ -1 +1 @@ -{"author":"Amazon Web Services, Inc.","config":{"Cmd":["/agent"],"ArgsEscaped":true},"created":"~~timestamp~~","history":[{"created":"~~timestamp~~","author":"Amazon Web Services, Inc.","created_by":"°o°","empty_layer":true}],"os":"linux","rootfs":{"type":"layers","diff_ids":["sha256:~~digest~~"]}} +{"author":"Amazon Web Services, Inc.","config":{"Cmd":["/agent"],"ArgsEscaped":true},"created":"~~timestamp~~","config":{"ExposedPorts":{"51678/tcp":{},"51679/tcp":{}},"Healthcheck":{"Test":["CMD","/agent","--healthcheck"]}},"history":[{"created":"~~timestamp~~","author":"Amazon Web Services, Inc.","created_by":"°o°","empty_layer":true}],"os":"linux","rootfs":{"type":"layers","diff_ids":["sha256:~~digest~~"]}} diff --git a/buildspecs/merge-build.yml b/buildspecs/merge-build.yml index 65aab8bfe7e..0613e124f8a 100644 --- a/buildspecs/merge-build.yml +++ b/buildspecs/merge-build.yml @@ -51,7 +51,7 @@ phases: # Git short sha - used to name artifacts and make release json # This variable is exported - - GIT_COMMIT_SHORT_SHA=$(git rev-parse --short HEAD) + - GIT_COMMIT_SHORT_SHA=$(git rev-parse --short=8 HEAD) # Different names of under which tar is released - ECS_AGENT_TAR="ecs-agent-v${AGENT_VERSION}.tar" diff --git a/buildspecs/release-config.yml b/buildspecs/release-config.yml index 546c76e8a45..c51b77b1273 100644 --- a/buildspecs/release-config.yml +++ b/buildspecs/release-config.yml @@ -27,11 +27,15 @@ phases: - RELEASE_DATE=$(date +'%Y%m%d') # Prepare agent.json config file + # TODO initStagingConfig.release version configurable - | cat << EOF > agent.json { "agentReleaseVersion" : "$AGENT_VERSION", "releaseDate" : "$RELEASE_DATE", + "initStagingConfig" { + "release": "1" + }, "agentStagingConfig": { "releaseGitSha": "$GIT_COMMIT_SHA", "releaseGitShortSha": "$GIT_COMMIT_SHORT_SHA", diff --git a/scripts/verify-agent-artifacts b/scripts/verify-agent-artifacts index ca247bf5d42..75dd24bb74e 100755 --- a/scripts/verify-agent-artifacts +++ b/scripts/verify-agent-artifacts @@ -16,7 +16,7 @@ AGENT_VERSION="${1:-}" BUCKET_NAME="${2:-}" -SHA=$(git rev-parse --short HEAD) +SHA=$(git rev-parse --short=8 HEAD) usage() { echo "Usage: ${0} AGENT_VERSION BUCKET_NAME"