Skip to content

Commit

Permalink
Installer scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
skyzyx committed Apr 17, 2024
1 parent 16bdd9c commit f963ba4
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 0 deletions.
16 changes: 16 additions & 0 deletions installer/alpine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env sh

# Environment variables
ALPINE_RELEASE="v$(cut /etc/alpine-release -d '.' -f 1,2)"

# Add the signing public key
wget -q \
https://nwlabs-381491855445-package-builder.s3.amazonaws.com/signing.key.pub \
-O /etc/apk/keys/northwood-labs.pub

cat <<EOF >>/etc/apk/repositories
https://nwlabs-381491855445-package-builder.s3.amazonaws.com/apk/${ALPINE_RELEASE}/main
EOF

# Update the index
apk update --allow-untrusted
23 changes: 23 additions & 0 deletions installer/amzn-2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -euo pipefail

# Add the signing public key
rpm --import https://keys.openpgp.org/vks/v1/by-fingerprint/2C1A348F6149F5AC21D9DCB68D4B026D3C7658F0
rpm --import https://nwlabs-381491855445-package-builder.s3.amazonaws.com/amazon-ssm-agent-exp20250217.asc

# Add the definition
# rpm <= v4.12 does not validate packages signed with subkeys.
# Disable GPG validation for this OS release.
cat <<EOF >/etc/yum.repos.d/northwood-labs.repo
[northwood-labs-amzn2]
name="Northwood Labs: Amazon Linux 2 Packages"
baseurl=https://nwlabs-381491855445-package-builder.s3.amazonaws.com/rpm/amazonlinux/2/\$basearch/
enabled=1
gpgcheck=0
priority=1
check_obsoletes=1
skip_if_unavailable=1
EOF

# Update the package index
yum clean all && rm -rf /var/cache/yum && yum -y update
23 changes: 23 additions & 0 deletions installer/amzn-2023.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -euo pipefail

# Add the signing public key
rpm --import https://keys.openpgp.org/vks/v1/by-fingerprint/2C1A348F6149F5AC21D9DCB68D4B026D3C7658F0
rpm --import https://nwlabs-381491855445-package-builder.s3.amazonaws.com/amazon-ssm-agent-exp20250217.asc

# Add the definition
cat <<EOF >/etc/yum.repos.d/northwood-labs.repo
[northwood-labs-amzn2023]
name="Northwood Labs: Amazon Linux 2023 Packages"
baseurl=https://nwlabs-381491855445-package-builder.s3.amazonaws.com/rpm/amazonlinux/2023/\$basearch/
enabled=1
gpgcheck=1
gpgkey=https://keys.openpgp.org/vks/v1/by-fingerprint/2C1A348F6149F5AC21D9DCB68D4B026D3C7658F0
https://nwlabs-381491855445-package-builder.s3.amazonaws.com/amazon-ssm-agent-exp20250217.asc
priority=1
check_obsoletes=1
skip_if_unavailable=1
EOF

# Update the package index
yum clean all && rm -rf /var/cache/yum && yum -y update
29 changes: 29 additions & 0 deletions installer/ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail

# Prerequisites
apt-get -y update
apt-get -y install --no-install-recommends \
apt-utils \
ca-certificates \
gnupg2 \
lsb-release \
software-properties-common \
;

# Add the signing public key
gpg --keyserver hkps://keys.openpgp.org \
--receive-keys 2C1A348F6149F5AC21D9DCB68D4B026D3C7658F0 2>/dev/null
gpg --output /etc/apt/trusted.gpg.d/northwood-labs.asc \
--armor \
--export 2C1A348F6149F5AC21D9DCB68D4B026D3C7658F0

# Add the definition
RELEASE="$(lsb_release -cs)"
mkdir -p /etc/apt/sources.list.d
cat <<EOF >/etc/apt/sources.list.d/northwood-labs.list
deb https://nwlabs-381491855445-package-builder.s3.amazonaws.com/apt ${RELEASE} main
EOF

# Update the package index
apt-get clean && apt-get autoclean && apt-get -y update

0 comments on commit f963ba4

Please sign in to comment.