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

Build changes - Add GitShortSha to config, Add md5, json file creation #3327

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

prateekchaudhry
Copy link
Contributor

Summary

This PR makes some changes and fixes to the build infrastructure of Agent. Mainly -

  1. Adds code to create md5 checksum file and json files containing agent version of the agent tars
  2. Adds a field releaseGitShortSha to the agent.json file produced at each release. This is computed as git rev-parse --short HEAD during the build stage of the tar files
  3. Adds code to make different renamed versions of the same tar files (*-latest.tar, *-{git short sha}.tar)
  4. Make changes to the release codepipeline to facilitate building and propagation of the above artifacts

Tested by building and running a codepipeline, and investigating the code in a forked repo

New tests cover the changes:

Description for the changelog

Add releaseGitShortSha to the agent.json; Build different renamed versions of agent, md5 checksum and json containing agent version in codepipeline

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Member

@fierlion fierlion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work overall -- clearly documented with good clear names and comprehensive checks.

# - ARM rpm
EnvironmentVariables: '[{"name":"GIT_COMMIT_SHA","value":"#{SourceVariables.CommitId}","type":"PLAINTEXT"},{"name":"ECS_AGENT_AMD_TAR","value":"#{AmdBuildVariables.ECS_AGENT_TAR}","type":"PLAINTEXT"},{"name":"ECS_AGENT_AMD_RPM","value":"#{AmdBuildVariables.ECS_AGENT_RPM}","type":"PLAINTEXT"},{"name":"ECS_AGENT_UBUNTU_AMD_DEB","value":"#{UbuntuAmdBuildVariables.ECS_AGENT_DEB}", "type":"PLAINTEXT"},{"name":"ECS_AGENT_UBUNTU_ARM_DEB","value":"#{UbuntuArmBuildVariables.ECS_AGENT_DEB}", "type":"PLAINTEXT"},{"name":"ECS_AGENT_ARM_TAR","value":"#{ArmBuildVariables.ECS_AGENT_TAR}","type":"PLAINTEXT"},{"name":"ECS_AGENT_ARM_RPM","value":"#{ArmBuildVariables.ECS_AGENT_RPM}","type":"PLAINTEXT"}]'
# Agent version and git short sha env variables to generate file names for signing
EnvironmentVariables: '[{"name":"AGENT_VERSION","value":"#{AmdBuildVariables.AGENT_VERSION}","type":"PLAINTEXT"},{"name":"GIT_COMMIT_SHORT_SHA","value":"#{AmdBuildVariables.GIT_COMMIT_SHORT_SHA}","type":"PLAINTEXT"},{"name":"INIT_VERSION","value":"#{AmdBuildVariables.INIT_VERSION}","type":"PLAINTEXT"}]'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convention over configuration, 👌

@fierlion fierlion merged commit a967d05 into aws:dev Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants