From b8987ba131f8cf556500bb7299772e848d7df2de Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Mon, 2 Dec 2024 09:14:42 +0530 Subject: [PATCH 01/17] added destPrefix input flag and removed hardcoded value infrastructure_agent --- linux/Dockerfile | 3 +++ linux/action.sh | 2 ++ linux/action.yml | 5 +++++ linux/helper_rockylinux.sh | 12 ++++++++++++ linux/helper_suse.sh | 13 ++++++++++++- linux/helper_ubuntu.sh | 8 ++++---- 6 files changed, 38 insertions(+), 5 deletions(-) diff --git a/linux/Dockerfile b/linux/Dockerfile index 36a9a43..4b3adc7 100644 --- a/linux/Dockerfile +++ b/linux/Dockerfile @@ -12,6 +12,8 @@ COPY helper*.sh rpm-repos/*.repo ./ ARG STAGING_REPO=false ENV STAGING_REPO=$STAGING_REPO +ARG DEST_PREFIX + # Run helper prepare. This adds the NR repo and installs the agent RUN ./helper.sh prepare @@ -41,4 +43,5 @@ RUN INTEGRATION=$INTEGRATION \ INSTALL_REPO=$INSTALL_REPO \ FAIL_REPO=$FAIL_REPO \ INSTALL_LOCAL=$INSTALL_LOCAL \ + DEST_PREFIX=$DEST_PREFIX \ ./helper.sh install diff --git a/linux/action.sh b/linux/action.sh index 43992de..f8243b2 100755 --- a/linux/action.sh +++ b/linux/action.sh @@ -8,6 +8,7 @@ set -o pipefail [[ -n $DISTROS ]] || DISTROS="ubuntu:jammy ubuntu:focal ubuntu:bionic debian:bullseye debian:buster rockylinux:8 registry.suse.com/suse/sles12sp5:latest suse" [[ -n $PKGDIR ]] || PKGDIR="./dist" [[ -n $PACKAGE_LOCATION ]] || PACKAGE_LOCATION="local" +[[ -n $DEST_PREFIX ]] || DEST_PREFIX="infrastructure_agent" # Strip leading v from TAG and REPO_VERSION if present TAG=${TAG/v/} @@ -125,6 +126,7 @@ function build_and_test() { --build-arg INSTALL_LOCAL="$install_local" \ --build-arg FAIL_REPO="$fail_repo" \ --build-arg STAGING_REPO="$STAGING_REPO" \ + --build-arg DEST_PREFIX="$DEST_PREFIX" \ "$dockerdir"; then echo "::endgroup::" echo "❌ Install for $dockertag failed" diff --git a/linux/action.yml b/linux/action.yml index 64056f3..244c479 100644 --- a/linux/action.yml +++ b/linux/action.yml @@ -41,6 +41,10 @@ inputs: description: 'Folder containing installer packages' required: false default: "" + destPrefix: + description: 'Prefix of the destination s3 path for downloading the artifacts' + required: false + default: "infrastructure_agent" runs: using: "composite" @@ -58,3 +62,4 @@ runs: POST_INSTALL_EXTRA: ${{ inputs.postInstallExtra }} DISTROS: ${{ inputs.distros }} PKGDIR: ${{ inputs.pkgDir }} + DEST_PREFIX: ${{ inputs.destPrefix }} diff --git a/linux/helper_rockylinux.sh b/linux/helper_rockylinux.sh index 4d0c777..3be6b7b 100755 --- a/linux/helper_rockylinux.sh +++ b/linux/helper_rockylinux.sh @@ -6,6 +6,18 @@ add_repo() { fi cp "newrelic-infra-rockylinux${env}.repo" /etc/yum.repos.d/newrelic-infra.repo + if [ "$STAGING_REPO" = "true" ]; then + if [ "$DEST_PREFIX" != "infrastructure_agent"]; then + sed -i "s|baseurl=http://nr-downloads-ohai-staging\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/yum/el/__VERSION__/x86_64|baseurl=http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/linux/yum/el/__VERSION__/x86_64|" /etc/yum.repos.d/newrelic-infra.repo + sed -i "s|gpgkey=http://nr-downloads-ohai-staging\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/gpg/newrelic-infra\.gpg|gpgkey=http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/gpg/newrelic-infra.gpg|" /etc/yum.repos.d/newrelic-infra.repo + fi + else + if [ "$DEST_PREFIX" != "infrastructure_agent"]; then + sed -i "s|baseurl=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/yum/el/__VERSION__/x86_64|baseurl=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/linux/yum/el/__VERSION__/x86_64|" /etc/yum.repos.d/newrelic-infra.repo + sed -i "s|gpgkey=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/gpg/newrelic-infra.gpg|gpgkey=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/gpg/newrelic-infra.gpg|" /etc/yum.repos.d/newrelic-infra.repo + fi + fi + # Get rockylinux version from docker tag, assuming it has a `:[0-9]` format version=${BASE_IMAGE##*:} sed -i "s/__VERSION__/$version/" /etc/yum.repos.d/newrelic-infra.repo diff --git a/linux/helper_suse.sh b/linux/helper_suse.sh index 5658808..c414830 100755 --- a/linux/helper_suse.sh +++ b/linux/helper_suse.sh @@ -27,11 +27,22 @@ add_repo() { zypper --gpg-auto-import-keys ref fi zypper -n install wget - wget -q "http://${domain}/infrastructure_agent/gpg/newrelic-infra.gpg" -O newrelic-infra.gpg + wget -q "http://${domain}/$DEST_PREFIX/gpg/newrelic-infra.gpg" -O newrelic-infra.gpg rpm --import newrelic-infra.gpg && rm newrelic-infra.gpg cp "newrelic-infra-suse${env}.repo" tmp.repo sed -e "s/__VERSION__/$VERSION_ID/g" tmp.repo > /etc/zypp/repos.d/newrelic-infra.repo + if [ "$STAGING_REPO" = "true" ]; then + if [ "$DEST_PREFIX" != "infrastructure_agent"]; then + sed -i "s|baseurl=http://nr-downloads-ohai-staging\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/zypp/sles/__VERSION__/x86_64|baseurl=http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/linux/zypp/sles/__VERSION__/x86_64|" /etc/zypp/repos.d/newrelic-infra.repo + sed -i "s|gpgkey=http://download\.newrelic\.com/infrastructure_agent/gpg/newrelic-infra\.gpg|gpgkey=http://download.newrelic.com/${DEST_PREFIX}/gpg/newrelic-infra.gpg|" /etc/zypp/repos.d/newrelic-infra.repo + fi + else + if [ "$DEST_PREFIX" != "infrastructure_agent"]; then + sed -i "s|baseurl=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/zypp/sles/__VERSION__/x86_64|baseurl=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/linux/zypp/sles/__VERSION__/x86_64|" /etc/zypp/repos.d/newrelic-infra.repo + sed -i "s|gpgkey=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/gpg/newrelic-infra.gpg|gpgkey=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/gpg/newrelic-infra.gpg|" /etc/zypp/repos.d/newrelic-infra.repo + fi + fi zypper --gpg-auto-import-keys ref } diff --git a/linux/helper_ubuntu.sh b/linux/helper_ubuntu.sh index a237e12..4c72e24 100755 --- a/linux/helper_ubuntu.sh +++ b/linux/helper_ubuntu.sh @@ -9,13 +9,13 @@ add_repo() { apt update && apt -y install wget gnupg if [ "$STAGING_REPO" = "true" ]; then - repo="http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt" + repo="http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/$DEST_PREFIX/linux/apt" else - repo="http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt" + repo="http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/$DEST_PREFIX/linux/apt" fi echo "deb [arch=amd64] $repo $version main" > /etc/apt/sources.list.d/newrelic-infra.list - wget -nv -O- http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/infrastructure_agent/gpg/newrelic-infra.gpg | apt-key add - + wget -nv -O- http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/$DEST_PREFIX/gpg/newrelic-infra.gpg | apt-key add - apt update } @@ -25,7 +25,7 @@ install_agent() { # apt install -y newrelic-infra AGENT_PACKAGE=${AGENT_PACKAGE:-newrelic-infra_systemd_1.15.2_systemd_amd64.deb} - wget -nv "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt/pool/main/n/newrelic-infra/${AGENT_PACKAGE}" + wget -nv "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/$DEST_PREFIX/linux/apt/pool/main/n/newrelic-infra/${AGENT_PACKAGE}" apt install "./${AGENT_PACKAGE}" } From ce9d126330153ce72aef44e8176686a0ce8c73bc Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Mon, 2 Dec 2024 10:08:06 +0530 Subject: [PATCH 02/17] added destPrefix for windows pkg installation test --- windows/action.yml | 5 +++++ windows/test_msi.ps1 | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/windows/action.yml b/windows/action.yml index d6cb8bf..55f9da6 100644 --- a/windows/action.yml +++ b/windows/action.yml @@ -45,6 +45,10 @@ inputs: description: 'Path to the upstream URL of the package. Will be concatenated with pkgUpstreamName to get the full URL' required: false default: "" + destPrefix: + description: 'Prefix of the destination s3 path for downloading the artifacts' + required: false + default: "infrastructure_agent" runs: using: "composite" @@ -61,6 +65,7 @@ runs: $Env:pkgUpstreamBaseURL="${{ inputs.pkgUpstreamBaseURL }}" $Env:pkgLatestName="${{ inputs.pkgLatestName }}" $Env:repoVersion="${{ inputs.repoVersion }}" + $Env:destPrefix="${{ inputs.destPrefix }}" ${{ github.action_path }}\test_msi.ps1 shell: pwsh diff --git a/windows/test_msi.ps1 b/windows/test_msi.ps1 index 56efacb..741b409 100644 --- a/windows/test_msi.ps1 +++ b/windows/test_msi.ps1 @@ -9,6 +9,7 @@ $PKG_NAME = "$env:pkgName" $PKG_UPSTREAM_URL_BASE = "$env:pkgUpstreamBaseURL" $PKG_UPSTREAM_NAME = "$env:pkgLatestName" $REPO_VERSION = "$env:repoVersion" +$DEST_PREFIX = "$env:destPrefix" if ($PKG_TYPE -NotMatch "msi" -And $PKG_TYPE -NotMatch "exe") { echo "❌ PKG_TYPE can only be 'msi' or 'exe'" @@ -34,7 +35,7 @@ if ($PKG_UPSTREAM_NAME -eq "") if ($PKG_UPSTREAM_URL_BASE -eq "") { - $url_base = "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/infrastructure_agent/windows" + $url_base = "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/windows" if ($ARCH -eq "386") { From 01a115edb8a1136dd5962de3f79122b4543efdf5 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Mon, 2 Dec 2024 10:52:06 +0530 Subject: [PATCH 03/17] removed destPrefix from windows and added destPrefix to readme --- README.md | 2 ++ windows/action.yml | 5 ----- windows/test_msi.ps1 | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4cfe6b8..b99887e 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ The following inputs can be specified to override the default behavior - default: `false` * `pkgDir`: Path where archives (.deb and .rpm) reside - default: `./dist` +* `destPrefix`: Prefix of the destination s3 path for downloading the artifacts + - default: `infrastructure_agent` ##### Supported `distros` diff --git a/windows/action.yml b/windows/action.yml index 55f9da6..d6cb8bf 100644 --- a/windows/action.yml +++ b/windows/action.yml @@ -45,10 +45,6 @@ inputs: description: 'Path to the upstream URL of the package. Will be concatenated with pkgUpstreamName to get the full URL' required: false default: "" - destPrefix: - description: 'Prefix of the destination s3 path for downloading the artifacts' - required: false - default: "infrastructure_agent" runs: using: "composite" @@ -65,7 +61,6 @@ runs: $Env:pkgUpstreamBaseURL="${{ inputs.pkgUpstreamBaseURL }}" $Env:pkgLatestName="${{ inputs.pkgLatestName }}" $Env:repoVersion="${{ inputs.repoVersion }}" - $Env:destPrefix="${{ inputs.destPrefix }}" ${{ github.action_path }}\test_msi.ps1 shell: pwsh diff --git a/windows/test_msi.ps1 b/windows/test_msi.ps1 index 741b409..56efacb 100644 --- a/windows/test_msi.ps1 +++ b/windows/test_msi.ps1 @@ -9,7 +9,6 @@ $PKG_NAME = "$env:pkgName" $PKG_UPSTREAM_URL_BASE = "$env:pkgUpstreamBaseURL" $PKG_UPSTREAM_NAME = "$env:pkgLatestName" $REPO_VERSION = "$env:repoVersion" -$DEST_PREFIX = "$env:destPrefix" if ($PKG_TYPE -NotMatch "msi" -And $PKG_TYPE -NotMatch "exe") { echo "❌ PKG_TYPE can only be 'msi' or 'exe'" @@ -35,7 +34,7 @@ if ($PKG_UPSTREAM_NAME -eq "") if ($PKG_UPSTREAM_URL_BASE -eq "") { - $url_base = "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/windows" + $url_base = "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/infrastructure_agent/windows" if ($ARCH -eq "386") { From aae5099c9f84a51235eb0b9a3dd979511bb95811 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Mon, 2 Dec 2024 13:57:03 +0530 Subject: [PATCH 04/17] made changes to accomodate / at end of destPrefix input flag --- linux/action.sh | 2 +- linux/action.yml | 2 +- linux/helper_rockylinux.sh | 12 ++++++------ linux/helper_suse.sh | 14 +++++++------- linux/helper_ubuntu.sh | 8 ++++---- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/linux/action.sh b/linux/action.sh index f8243b2..25d7ef5 100755 --- a/linux/action.sh +++ b/linux/action.sh @@ -8,7 +8,7 @@ set -o pipefail [[ -n $DISTROS ]] || DISTROS="ubuntu:jammy ubuntu:focal ubuntu:bionic debian:bullseye debian:buster rockylinux:8 registry.suse.com/suse/sles12sp5:latest suse" [[ -n $PKGDIR ]] || PKGDIR="./dist" [[ -n $PACKAGE_LOCATION ]] || PACKAGE_LOCATION="local" -[[ -n $DEST_PREFIX ]] || DEST_PREFIX="infrastructure_agent" +[[ -n $DEST_PREFIX ]] || DEST_PREFIX="infrastructure_agent/" # Strip leading v from TAG and REPO_VERSION if present TAG=${TAG/v/} diff --git a/linux/action.yml b/linux/action.yml index 244c479..5b8beca 100644 --- a/linux/action.yml +++ b/linux/action.yml @@ -44,7 +44,7 @@ inputs: destPrefix: description: 'Prefix of the destination s3 path for downloading the artifacts' required: false - default: "infrastructure_agent" + default: "infrastructure_agent/" runs: using: "composite" diff --git a/linux/helper_rockylinux.sh b/linux/helper_rockylinux.sh index 3be6b7b..de8f60e 100755 --- a/linux/helper_rockylinux.sh +++ b/linux/helper_rockylinux.sh @@ -7,14 +7,14 @@ add_repo() { cp "newrelic-infra-rockylinux${env}.repo" /etc/yum.repos.d/newrelic-infra.repo if [ "$STAGING_REPO" = "true" ]; then - if [ "$DEST_PREFIX" != "infrastructure_agent"]; then - sed -i "s|baseurl=http://nr-downloads-ohai-staging\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/yum/el/__VERSION__/x86_64|baseurl=http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/linux/yum/el/__VERSION__/x86_64|" /etc/yum.repos.d/newrelic-infra.repo - sed -i "s|gpgkey=http://nr-downloads-ohai-staging\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/gpg/newrelic-infra\.gpg|gpgkey=http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/gpg/newrelic-infra.gpg|" /etc/yum.repos.d/newrelic-infra.repo + if [ "$DEST_PREFIX" != "infrastructure_agent/"]; then + sed -i "s|baseurl=http://nr-downloads-ohai-staging\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/yum/el/__VERSION__/x86_64|baseurl=http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/yum/el/__VERSION__/x86_64|" /etc/yum.repos.d/newrelic-infra.repo + sed -i "s|gpgkey=http://nr-downloads-ohai-staging\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/gpg/newrelic-infra\.gpg|gpgkey=http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}gpg/newrelic-infra.gpg|" /etc/yum.repos.d/newrelic-infra.repo fi else - if [ "$DEST_PREFIX" != "infrastructure_agent"]; then - sed -i "s|baseurl=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/yum/el/__VERSION__/x86_64|baseurl=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/linux/yum/el/__VERSION__/x86_64|" /etc/yum.repos.d/newrelic-infra.repo - sed -i "s|gpgkey=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/gpg/newrelic-infra.gpg|gpgkey=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/gpg/newrelic-infra.gpg|" /etc/yum.repos.d/newrelic-infra.repo + if [ "$DEST_PREFIX" != "infrastructure_agent/"]; then + sed -i "s|baseurl=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/yum/el/__VERSION__/x86_64|baseurl=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/yum/el/__VERSION__/x86_64|" /etc/yum.repos.d/newrelic-infra.repo + sed -i "s|gpgkey=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/gpg/newrelic-infra.gpg|gpgkey=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}gpg/newrelic-infra.gpg|" /etc/yum.repos.d/newrelic-infra.repo fi fi diff --git a/linux/helper_suse.sh b/linux/helper_suse.sh index c414830..3b5a585 100755 --- a/linux/helper_suse.sh +++ b/linux/helper_suse.sh @@ -27,20 +27,20 @@ add_repo() { zypper --gpg-auto-import-keys ref fi zypper -n install wget - wget -q "http://${domain}/$DEST_PREFIX/gpg/newrelic-infra.gpg" -O newrelic-infra.gpg + wget -q "http://${domain}/${DEST_PREFIX}gpg/newrelic-infra.gpg" -O newrelic-infra.gpg rpm --import newrelic-infra.gpg && rm newrelic-infra.gpg cp "newrelic-infra-suse${env}.repo" tmp.repo sed -e "s/__VERSION__/$VERSION_ID/g" tmp.repo > /etc/zypp/repos.d/newrelic-infra.repo if [ "$STAGING_REPO" = "true" ]; then - if [ "$DEST_PREFIX" != "infrastructure_agent"]; then - sed -i "s|baseurl=http://nr-downloads-ohai-staging\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/zypp/sles/__VERSION__/x86_64|baseurl=http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/linux/zypp/sles/__VERSION__/x86_64|" /etc/zypp/repos.d/newrelic-infra.repo - sed -i "s|gpgkey=http://download\.newrelic\.com/infrastructure_agent/gpg/newrelic-infra\.gpg|gpgkey=http://download.newrelic.com/${DEST_PREFIX}/gpg/newrelic-infra.gpg|" /etc/zypp/repos.d/newrelic-infra.repo + if [ "$DEST_PREFIX" != "infrastructure_agent/"]; then + sed -i "s|baseurl=http://nr-downloads-ohai-staging\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/zypp/sles/__VERSION__/x86_64|baseurl=http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/zypp/sles/__VERSION__/x86_64|" /etc/zypp/repos.d/newrelic-infra.repo + sed -i "s|gpgkey=http://download\.newrelic\.com/infrastructure_agent/gpg/newrelic-infra\.gpg|gpgkey=http://download.newrelic.com/${DEST_PREFIX}gpg/newrelic-infra.gpg|" /etc/zypp/repos.d/newrelic-infra.repo fi else - if [ "$DEST_PREFIX" != "infrastructure_agent"]; then - sed -i "s|baseurl=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/zypp/sles/__VERSION__/x86_64|baseurl=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/linux/zypp/sles/__VERSION__/x86_64|" /etc/zypp/repos.d/newrelic-infra.repo - sed -i "s|gpgkey=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/gpg/newrelic-infra.gpg|gpgkey=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/gpg/newrelic-infra.gpg|" /etc/zypp/repos.d/newrelic-infra.repo + if [ "$DEST_PREFIX" != "infrastructure_agent/"]; then + sed -i "s|baseurl=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/zypp/sles/__VERSION__/x86_64|baseurl=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/zypp/sles/__VERSION__/x86_64|" /etc/zypp/repos.d/newrelic-infra.repo + sed -i "s|gpgkey=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/gpg/newrelic-infra.gpg|gpgkey=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}gpg/newrelic-infra.gpg|" /etc/zypp/repos.d/newrelic-infra.repo fi fi zypper --gpg-auto-import-keys ref diff --git a/linux/helper_ubuntu.sh b/linux/helper_ubuntu.sh index 4c72e24..eb272a4 100755 --- a/linux/helper_ubuntu.sh +++ b/linux/helper_ubuntu.sh @@ -9,13 +9,13 @@ add_repo() { apt update && apt -y install wget gnupg if [ "$STAGING_REPO" = "true" ]; then - repo="http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/$DEST_PREFIX/linux/apt" + repo="http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/apt" else - repo="http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/$DEST_PREFIX/linux/apt" + repo="http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/apt" fi echo "deb [arch=amd64] $repo $version main" > /etc/apt/sources.list.d/newrelic-infra.list - wget -nv -O- http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/$DEST_PREFIX/gpg/newrelic-infra.gpg | apt-key add - + wget -nv -O- http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}gpg/newrelic-infra.gpg | apt-key add - apt update } @@ -25,7 +25,7 @@ install_agent() { # apt install -y newrelic-infra AGENT_PACKAGE=${AGENT_PACKAGE:-newrelic-infra_systemd_1.15.2_systemd_amd64.deb} - wget -nv "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/$DEST_PREFIX/linux/apt/pool/main/n/newrelic-infra/${AGENT_PACKAGE}" + wget -nv "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/apt/pool/main/n/newrelic-infra/${AGENT_PACKAGE}" apt install "./${AGENT_PACKAGE}" } From fe69b37d1dbb0bc1bcb2d8d2a658bdbfd1b54b52 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Mon, 2 Dec 2024 16:44:19 +0530 Subject: [PATCH 05/17] removed destPrefix from gpg path and using infrastructure_agent --- README.md | 2 +- linux/helper_rockylinux.sh | 4 ++-- linux/helper_suse.sh | 6 +++--- linux/helper_ubuntu.sh | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b99887e..b884fdf 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ The following inputs can be specified to override the default behavior * `pkgDir`: Path where archives (.deb and .rpm) reside - default: `./dist` * `destPrefix`: Prefix of the destination s3 path for downloading the artifacts - - default: `infrastructure_agent` + - default: `infrastructure_agent/` ##### Supported `distros` diff --git a/linux/helper_rockylinux.sh b/linux/helper_rockylinux.sh index de8f60e..e238f8e 100755 --- a/linux/helper_rockylinux.sh +++ b/linux/helper_rockylinux.sh @@ -9,12 +9,12 @@ add_repo() { if [ "$STAGING_REPO" = "true" ]; then if [ "$DEST_PREFIX" != "infrastructure_agent/"]; then sed -i "s|baseurl=http://nr-downloads-ohai-staging\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/yum/el/__VERSION__/x86_64|baseurl=http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/yum/el/__VERSION__/x86_64|" /etc/yum.repos.d/newrelic-infra.repo - sed -i "s|gpgkey=http://nr-downloads-ohai-staging\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/gpg/newrelic-infra\.gpg|gpgkey=http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}gpg/newrelic-infra.gpg|" /etc/yum.repos.d/newrelic-infra.repo + # sed -i "s|gpgkey=http://nr-downloads-ohai-staging\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/gpg/newrelic-infra\.gpg|gpgkey=http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}gpg/newrelic-infra.gpg|" /etc/yum.repos.d/newrelic-infra.repo fi else if [ "$DEST_PREFIX" != "infrastructure_agent/"]; then sed -i "s|baseurl=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/yum/el/__VERSION__/x86_64|baseurl=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/yum/el/__VERSION__/x86_64|" /etc/yum.repos.d/newrelic-infra.repo - sed -i "s|gpgkey=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/gpg/newrelic-infra.gpg|gpgkey=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}gpg/newrelic-infra.gpg|" /etc/yum.repos.d/newrelic-infra.repo + # sed -i "s|gpgkey=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/gpg/newrelic-infra.gpg|gpgkey=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}gpg/newrelic-infra.gpg|" /etc/yum.repos.d/newrelic-infra.repo fi fi diff --git a/linux/helper_suse.sh b/linux/helper_suse.sh index 3b5a585..cacfaaf 100755 --- a/linux/helper_suse.sh +++ b/linux/helper_suse.sh @@ -27,7 +27,7 @@ add_repo() { zypper --gpg-auto-import-keys ref fi zypper -n install wget - wget -q "http://${domain}/${DEST_PREFIX}gpg/newrelic-infra.gpg" -O newrelic-infra.gpg + wget -q "http://${domain}/infrastructure_agent/gpg/newrelic-infra.gpg" -O newrelic-infra.gpg rpm --import newrelic-infra.gpg && rm newrelic-infra.gpg cp "newrelic-infra-suse${env}.repo" tmp.repo @@ -35,12 +35,12 @@ add_repo() { if [ "$STAGING_REPO" = "true" ]; then if [ "$DEST_PREFIX" != "infrastructure_agent/"]; then sed -i "s|baseurl=http://nr-downloads-ohai-staging\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/zypp/sles/__VERSION__/x86_64|baseurl=http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/zypp/sles/__VERSION__/x86_64|" /etc/zypp/repos.d/newrelic-infra.repo - sed -i "s|gpgkey=http://download\.newrelic\.com/infrastructure_agent/gpg/newrelic-infra\.gpg|gpgkey=http://download.newrelic.com/${DEST_PREFIX}gpg/newrelic-infra.gpg|" /etc/zypp/repos.d/newrelic-infra.repo + # sed -i "s|gpgkey=http://download\.newrelic\.com/infrastructure_agent/gpg/newrelic-infra\.gpg|gpgkey=http://download.newrelic.com/${DEST_PREFIX}gpg/newrelic-infra.gpg|" /etc/zypp/repos.d/newrelic-infra.repo fi else if [ "$DEST_PREFIX" != "infrastructure_agent/"]; then sed -i "s|baseurl=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/linux/zypp/sles/__VERSION__/x86_64|baseurl=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/zypp/sles/__VERSION__/x86_64|" /etc/zypp/repos.d/newrelic-infra.repo - sed -i "s|gpgkey=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/gpg/newrelic-infra.gpg|gpgkey=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}gpg/newrelic-infra.gpg|" /etc/zypp/repos.d/newrelic-infra.repo + # sed -i "s|gpgkey=http://nr-downloads-main\.s3-website-us-east-1\.amazonaws\.com/infrastructure_agent/gpg/newrelic-infra.gpg|gpgkey=http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}gpg/newrelic-infra.gpg|" /etc/zypp/repos.d/newrelic-infra.repo fi fi zypper --gpg-auto-import-keys ref diff --git a/linux/helper_ubuntu.sh b/linux/helper_ubuntu.sh index eb272a4..0d2c324 100755 --- a/linux/helper_ubuntu.sh +++ b/linux/helper_ubuntu.sh @@ -15,7 +15,7 @@ add_repo() { fi echo "deb [arch=amd64] $repo $version main" > /etc/apt/sources.list.d/newrelic-infra.list - wget -nv -O- http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}gpg/newrelic-infra.gpg | apt-key add - + wget -nv -O- http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/infrastructure_agent/gpg/newrelic-infra.gpg | apt-key add - apt update } From f9358ae7c32066ee487778558cfb02c262f60777 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Mon, 2 Dec 2024 17:54:29 +0530 Subject: [PATCH 06/17] removed destPrefix from install agent step --- linux/helper_ubuntu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/helper_ubuntu.sh b/linux/helper_ubuntu.sh index 0d2c324..7e97f0a 100755 --- a/linux/helper_ubuntu.sh +++ b/linux/helper_ubuntu.sh @@ -25,7 +25,7 @@ install_agent() { # apt install -y newrelic-infra AGENT_PACKAGE=${AGENT_PACKAGE:-newrelic-infra_systemd_1.15.2_systemd_amd64.deb} - wget -nv "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/apt/pool/main/n/newrelic-infra/${AGENT_PACKAGE}" + wget -nv "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt/pool/main/n/newrelic-infra/${AGENT_PACKAGE}" apt install "./${AGENT_PACKAGE}" } From c74d6b05ab96220c984d4cc9bb3e64ba9ea6e0b0 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Tue, 3 Dec 2024 12:26:06 +0530 Subject: [PATCH 07/17] added ls commands for testing --- linux/action.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux/action.sh b/linux/action.sh index 25d7ef5..4ba44ac 100755 --- a/linux/action.sh +++ b/linux/action.sh @@ -142,6 +142,11 @@ function build_and_test() { while read -r check; do [[ -n $check ]] || continue # Skip empty lines # Feed each check to a fresh instance of the docker container + # List the contents of the directory + echo "Listing contents of /opt/newrelic-infra/newrelic-integrations/bin/:" + ls /opt/newrelic-infra/newrelic-integrations/bin/ + echo "Listing contents of /var/db/newrelic-infra/newrelic-integrations/bin/:" + ls /var/db/newrelic-infra/newrelic-integrations/bin/ if ! (echo "$check" | docker run --rm -i "$dockertag"); then echo " ❌ $check" failed=1 From e5e17993ba7e33e7d767d4f6e910d9a876444bed Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Tue, 3 Dec 2024 12:29:41 +0530 Subject: [PATCH 08/17] added ls commands for testing --- linux/action.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linux/action.sh b/linux/action.sh index 4ba44ac..9d2eb6c 100755 --- a/linux/action.sh +++ b/linux/action.sh @@ -144,9 +144,11 @@ function build_and_test() { # Feed each check to a fresh instance of the docker container # List the contents of the directory echo "Listing contents of /opt/newrelic-infra/newrelic-integrations/bin/:" - ls /opt/newrelic-infra/newrelic-integrations/bin/ + pwd + ls + ls /opt echo "Listing contents of /var/db/newrelic-infra/newrelic-integrations/bin/:" - ls /var/db/newrelic-infra/newrelic-integrations/bin/ + ls /var if ! (echo "$check" | docker run --rm -i "$dockertag"); then echo " ❌ $check" failed=1 From 296dc27ffa7756e7175bfe5b3dd2823ab8438f6a Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Tue, 3 Dec 2024 12:33:58 +0530 Subject: [PATCH 09/17] added ls commands for testing --- linux/action.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux/action.sh b/linux/action.sh index 9d2eb6c..9398d68 100755 --- a/linux/action.sh +++ b/linux/action.sh @@ -144,10 +144,14 @@ function build_and_test() { # Feed each check to a fresh instance of the docker container # List the contents of the directory echo "Listing contents of /opt/newrelic-infra/newrelic-integrations/bin/:" + echo "This is the pwd:" pwd + echo "Files in current dir:" ls + echo "Files in /opt:" ls /opt echo "Listing contents of /var/db/newrelic-infra/newrelic-integrations/bin/:" + echo "Files in /var:" ls /var if ! (echo "$check" | docker run --rm -i "$dockertag"); then echo " ❌ $check" From 14f2683db292750a6988ef1c0306a59ade7bb84c Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Tue, 3 Dec 2024 18:50:01 +0530 Subject: [PATCH 10/17] removed ls commands --- linux/action.sh | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/linux/action.sh b/linux/action.sh index 9398d68..25d7ef5 100755 --- a/linux/action.sh +++ b/linux/action.sh @@ -142,17 +142,6 @@ function build_and_test() { while read -r check; do [[ -n $check ]] || continue # Skip empty lines # Feed each check to a fresh instance of the docker container - # List the contents of the directory - echo "Listing contents of /opt/newrelic-infra/newrelic-integrations/bin/:" - echo "This is the pwd:" - pwd - echo "Files in current dir:" - ls - echo "Files in /opt:" - ls /opt - echo "Listing contents of /var/db/newrelic-infra/newrelic-integrations/bin/:" - echo "Files in /var:" - ls /var if ! (echo "$check" | docker run --rm -i "$dockertag"); then echo " ❌ $check" failed=1 From 17543b8beeeb7ef47f4e318a0f7c110e72a5896c Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Wed, 4 Dec 2024 10:21:42 +0530 Subject: [PATCH 11/17] removed destPrefix for staging and updated newrelic infra systemd version --- linux/helper_ubuntu.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/helper_ubuntu.sh b/linux/helper_ubuntu.sh index 7e97f0a..7f05b09 100755 --- a/linux/helper_ubuntu.sh +++ b/linux/helper_ubuntu.sh @@ -9,7 +9,7 @@ add_repo() { apt update && apt -y install wget gnupg if [ "$STAGING_REPO" = "true" ]; then - repo="http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/apt" + repo="http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt" else repo="http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/apt" fi @@ -24,7 +24,7 @@ install_agent() { # TODO: Use the repo version when the staging repo gets fixed, since the systemd issue is workarounded # apt install -y newrelic-infra - AGENT_PACKAGE=${AGENT_PACKAGE:-newrelic-infra_systemd_1.15.2_systemd_amd64.deb} + AGENT_PACKAGE=${AGENT_PACKAGE:-newrelic-infra_systemd_1.58.0_systemd_amd64.deb} wget -nv "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt/pool/main/n/newrelic-infra/${AGENT_PACKAGE}" apt install "./${AGENT_PACKAGE}" } From 1b9f5e99c71c85bb53e95c684d53ac4b801265ef Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Wed, 4 Dec 2024 11:11:44 +0530 Subject: [PATCH 12/17] updated the agent package value --- linux/helper_ubuntu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/helper_ubuntu.sh b/linux/helper_ubuntu.sh index 7f05b09..44cf944 100755 --- a/linux/helper_ubuntu.sh +++ b/linux/helper_ubuntu.sh @@ -24,7 +24,7 @@ install_agent() { # TODO: Use the repo version when the staging repo gets fixed, since the systemd issue is workarounded # apt install -y newrelic-infra - AGENT_PACKAGE=${AGENT_PACKAGE:-newrelic-infra_systemd_1.58.0_systemd_amd64.deb} + AGENT_PACKAGE=${AGENT_PACKAGE:-newrelic-infra_systemd_1.58.0_amd64.deb} wget -nv "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt/pool/main/n/newrelic-infra/${AGENT_PACKAGE}" apt install "./${AGENT_PACKAGE}" } From 28ef1cbd52dd01ad0000d5a7c7eeb6ae650076f1 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Wed, 4 Dec 2024 11:55:48 +0530 Subject: [PATCH 13/17] installing fluent-bit as it is required by newrelic-infra --- linux/helper_ubuntu.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux/helper_ubuntu.sh b/linux/helper_ubuntu.sh index 44cf944..e5f2c16 100755 --- a/linux/helper_ubuntu.sh +++ b/linux/helper_ubuntu.sh @@ -24,6 +24,10 @@ install_agent() { # TODO: Use the repo version when the staging repo gets fixed, since the systemd issue is workarounded # apt install -y newrelic-infra + FLUENT_AGENT_PACKAGE=${FLUENT_AGENT_PACKAGE:-fluent-bit_2.0.8_ubuntu-jammy_amd64.deb} + wget -nv "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt/pool/main/f/fluent-bit/${FLUENT_AGENT_PACKAGE}" + apt install "./${FLUENT_AGENT_PACKAGE}" + AGENT_PACKAGE=${AGENT_PACKAGE:-newrelic-infra_systemd_1.58.0_amd64.deb} wget -nv "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt/pool/main/n/newrelic-infra/${AGENT_PACKAGE}" apt install "./${AGENT_PACKAGE}" From 820c71310c6af66438989abbea8fad308bf6a72a Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Wed, 4 Dec 2024 12:31:05 +0530 Subject: [PATCH 14/17] using destPrefix when its value is not infrastructure_agent --- linux/helper_ubuntu.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/linux/helper_ubuntu.sh b/linux/helper_ubuntu.sh index e5f2c16..3302d97 100755 --- a/linux/helper_ubuntu.sh +++ b/linux/helper_ubuntu.sh @@ -9,9 +9,13 @@ add_repo() { apt update && apt -y install wget gnupg if [ "$STAGING_REPO" = "true" ]; then - repo="http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt" + if [ "$DEST_PREFIX" != "infrastructure_agent/"]; then + repo="http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/linux/apt" + else + repo="http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt" + fi else - repo="http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/apt" + repo="http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt" fi echo "deb [arch=amd64] $repo $version main" > /etc/apt/sources.list.d/newrelic-infra.list From 19f17e7871b5410fea08ba7a2fde82884d84a588 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Wed, 4 Dec 2024 15:51:48 +0530 Subject: [PATCH 15/17] added echos for debugging and removed installing fluent bit --- linux/helper_ubuntu.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/linux/helper_ubuntu.sh b/linux/helper_ubuntu.sh index 3302d97..ff1821d 100755 --- a/linux/helper_ubuntu.sh +++ b/linux/helper_ubuntu.sh @@ -9,12 +9,16 @@ add_repo() { apt update && apt -y install wget gnupg if [ "$STAGING_REPO" = "true" ]; then + echo "staginRepo is true" if [ "$DEST_PREFIX" != "infrastructure_agent/"]; then - repo="http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}/linux/apt" + echo "destPrefix is not infrastructure_agent/ it is $DEST_PREFIX" + repo="http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/apt" else + echo "destPrefix is $DEST_PREFIX" repo="http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt" fi else + echo "staginRepo is false" repo="http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt" fi @@ -28,11 +32,7 @@ install_agent() { # TODO: Use the repo version when the staging repo gets fixed, since the systemd issue is workarounded # apt install -y newrelic-infra - FLUENT_AGENT_PACKAGE=${FLUENT_AGENT_PACKAGE:-fluent-bit_2.0.8_ubuntu-jammy_amd64.deb} - wget -nv "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt/pool/main/f/fluent-bit/${FLUENT_AGENT_PACKAGE}" - apt install "./${FLUENT_AGENT_PACKAGE}" - - AGENT_PACKAGE=${AGENT_PACKAGE:-newrelic-infra_systemd_1.58.0_amd64.deb} + AGENT_PACKAGE=${AGENT_PACKAGE:-newrelic-infra_systemd_1.15.2_systemd_amd64.deb} wget -nv "http://nr-downloads-main.s3-website-us-east-1.amazonaws.com/infrastructure_agent/linux/apt/pool/main/n/newrelic-infra/${AGENT_PACKAGE}" apt install "./${AGENT_PACKAGE}" } From 1065e1735005088d67f1019cdf6b9f5532eb32d3 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Wed, 4 Dec 2024 16:50:16 +0530 Subject: [PATCH 16/17] fix not-equal syntax --- linux/helper_ubuntu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/helper_ubuntu.sh b/linux/helper_ubuntu.sh index ff1821d..00a0b05 100755 --- a/linux/helper_ubuntu.sh +++ b/linux/helper_ubuntu.sh @@ -10,7 +10,7 @@ add_repo() { apt update && apt -y install wget gnupg if [ "$STAGING_REPO" = "true" ]; then echo "staginRepo is true" - if [ "$DEST_PREFIX" != "infrastructure_agent/"]; then + if [ "$DEST_PREFIX" -ne "infrastructure_agent/"]; then echo "destPrefix is not infrastructure_agent/ it is $DEST_PREFIX" repo="http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/apt" else From 6da59d58dac74fc195a15d82eeed76459536683c Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Wed, 4 Dec 2024 17:49:59 +0530 Subject: [PATCH 17/17] fixed if condition --- linux/helper_ubuntu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/helper_ubuntu.sh b/linux/helper_ubuntu.sh index 00a0b05..4dcfec3 100755 --- a/linux/helper_ubuntu.sh +++ b/linux/helper_ubuntu.sh @@ -10,7 +10,7 @@ add_repo() { apt update && apt -y install wget gnupg if [ "$STAGING_REPO" = "true" ]; then echo "staginRepo is true" - if [ "$DEST_PREFIX" -ne "infrastructure_agent/"]; then + if [ "$DEST_PREFIX" != "infrastructure_agent/" ]; then echo "destPrefix is not infrastructure_agent/ it is $DEST_PREFIX" repo="http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${DEST_PREFIX}linux/apt" else