Skip to content

Commit

Permalink
Merge pull request #818 from nitrocode/session-manager-plugin
Browse files Browse the repository at this point in the history
Session manager plugin
  • Loading branch information
yob authored Mar 25, 2021
2 parents b30aee2 + dae96ca commit 083f89d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packer/linux/buildkite-ami.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
"type": "shell",
"script": "scripts/install-git-lfs.sh"
},
{
"type": "shell",
"script": "scripts/install-session-manager-plugin.sh"
},
{
"type": "shell",
"inline": [
Expand Down
20 changes: 20 additions & 0 deletions packer/linux/scripts/install-session-manager-plugin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -eu -o pipefail

SESSION_MANAGER_PLUGIN_VERSION=1.2.30.0

MACHINE="$(uname -m)"

case "${MACHINE}" in
x86_64) ARCH=64bit;;
aarch64) ARCH=arm64;;
*) ARCH=unknown;;
esac

echo "Installing session-manager-plugin $SESSION_MANAGER_PLUGIN_VERSION..."

curl \
"https://s3.amazonaws.com/session-manager-downloads/plugin/$SESSION_MANAGER_PLUGIN_VERSION/linux_$ARCH/session-manager-plugin.rpm" \
-o /tmp/session-manager-plugin.rpm
sudo yum install -y /tmp/session-manager-plugin.rpm
rm /tmp/session-manager-plugin.rpm
4 changes: 4 additions & 0 deletions packer/windows/buildkite-ami.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
"type": "powershell",
"script": "scripts/install-buildkite-agent.ps1"
},
{
"type": "powershell",
"script": "scripts/install-session-manager-plugin.ps1"
},
{
"type": "powershell",
"inline": ["Remove-Item -Path C:/packer-temp -Recurse"]
Expand Down
7 changes: 7 additions & 0 deletions packer/windows/scripts/install-session-manager-plugin.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Stop script execution when a non-terminating error occurs
$ErrorActionPreference = "Stop"

$SESSION_MANAGER_PLUGIN_VERSION = "1.2.30.0"

Write-Output "Installing session-manager-plugin ${SESSION_MANAGER_PLUGIN_VERSION}..."
Invoke-WebRequest -OutFile C:\buildkite-agent\bin\SessionManagerPluginSetup.exe -Uri "https://s3.amazonaws.com/session-manager-downloads/plugin/${SESSION_MANAGER_PLUGIN_VERSION}/windows/SessionManagerPluginSetup.exe"

0 comments on commit 083f89d

Please sign in to comment.