Skip to content

Commit

Permalink
app-emulation/amazon-ssm-agent: use upstream makefile
Browse files Browse the repository at this point in the history
By maintaining our own build logic, we missed the fact that the agent
was now split in two parts:
* amazon-ssm-agent in `./core`
* ssm-agent-worker in `./agent`

With the runtimeconfig passed from the `core` to the `agent`.

We were currently shipping `ssm-agent-worker` as the `amazon-ssm-agent`
hence some errors we had.

```
amazon-ssm-agent[8929]: 2023-12-28 15:29:32 WARN [ssm-agent-worker] failed to read runtime config 'identity_config.json': open /var/lib/amazon/ssm/runtimeconfig/identity_config.json: no such file or directory
```

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
  • Loading branch information
tormath1 authored and jepio committed Jan 16, 2024
1 parent c1e287f commit 285c80a
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 57 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Distributed under the terms of the GNU General Public License v2

EAPI=7

COREOS_GO_PACKAGE="${GITHUB_URI}"
COREOS_GO_VERSION="go1.19"

inherit coreos-go-depend golang-vcs-snapshot systemd

EGO_PN="github.com/aws/${PN}"
DESCRIPTION="AWS Systems Manager Agent"
HOMEPAGE="https://github.com/aws/amazon-ssm-agent"
LICENSE="Apache-2.0"
SRC_URI="https://${EGO_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz ${EGO_VENDOR_URI}"
SLOT="0"
KEYWORDS="amd64 arm64"

S="${WORKDIR}/${PN}-${PV}/src/${EGO_PN}"

PATCHES=(
)

src_prepare() {
default
ln -s ${PWD}/vendor/src/* ${PWD}/vendor/
}

src_compile() {
go_export

# set agent release version
BRAZIL_PACKAGE_VERSION=${PV} ${EGO} run ./agent/version/versiongenerator/version-gen.go
# build all the tools
if [[ "${ARCH}" == "arm64" ]]; then
emake build-arm64
else
emake build-linux
fi
}

src_install() {
# Folder is like bin/linux_amd64/
dobin bin/*/*
insinto "/usr/share/amazon/ssm"
newins seelog_unix.xml seelog.xml.template
doins amazon-ssm-agent.json.template

systemd_dounit packaging/linux/amazon-ssm-agent.service
}

0 comments on commit 285c80a

Please sign in to comment.