Skip to content

Commit 083f89d

Browse files
author
James Healy
authored
Merge pull request #818 from nitrocode/session-manager-plugin
Session manager plugin
2 parents b30aee2 + dae96ca commit 083f89d

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

packer/linux/buildkite-ami.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@
6666
"type": "shell",
6767
"script": "scripts/install-git-lfs.sh"
6868
},
69+
{
70+
"type": "shell",
71+
"script": "scripts/install-session-manager-plugin.sh"
72+
},
6973
{
7074
"type": "shell",
7175
"inline": [
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
set -eu -o pipefail
3+
4+
SESSION_MANAGER_PLUGIN_VERSION=1.2.30.0
5+
6+
MACHINE="$(uname -m)"
7+
8+
case "${MACHINE}" in
9+
x86_64) ARCH=64bit;;
10+
aarch64) ARCH=arm64;;
11+
*) ARCH=unknown;;
12+
esac
13+
14+
echo "Installing session-manager-plugin $SESSION_MANAGER_PLUGIN_VERSION..."
15+
16+
curl \
17+
"https://s3.amazonaws.com/session-manager-downloads/plugin/$SESSION_MANAGER_PLUGIN_VERSION/linux_$ARCH/session-manager-plugin.rpm" \
18+
-o /tmp/session-manager-plugin.rpm
19+
sudo yum install -y /tmp/session-manager-plugin.rpm
20+
rm /tmp/session-manager-plugin.rpm

packer/windows/buildkite-ami.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
"type": "powershell",
6262
"script": "scripts/install-buildkite-agent.ps1"
6363
},
64+
{
65+
"type": "powershell",
66+
"script": "scripts/install-session-manager-plugin.ps1"
67+
},
6468
{
6569
"type": "powershell",
6670
"inline": ["Remove-Item -Path C:/packer-temp -Recurse"]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Stop script execution when a non-terminating error occurs
2+
$ErrorActionPreference = "Stop"
3+
4+
$SESSION_MANAGER_PLUGIN_VERSION = "1.2.30.0"
5+
6+
Write-Output "Installing session-manager-plugin ${SESSION_MANAGER_PLUGIN_VERSION}..."
7+
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 commit comments

Comments
 (0)