Skip to content

Commit

Permalink
Merge pull request #287 from veraison/bootstrap-ol
Browse files Browse the repository at this point in the history
Add bootstrap script for Oracle Linux
  • Loading branch information
jraman567 authored Dec 10, 2024
2 parents cdeba76 + 38b381e commit 1fdc24a
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 10 deletions.
6 changes: 3 additions & 3 deletions deployments/aws/deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ function bootstrap() {
Linux)
# shellcheck disable=SC2002
local distrib_id
distrib_id=$(head -n 1 </etc/lsb-release 2>/dev/null | \
distrib_id=$(cat /etc/os-release | grep -w ID | \
cut -f2 -d= | tr -d \")

case $distrib_id in
Arch) sudo pacman -Syy packer ssh openssl;;
Ubuntu)
arch) sudo pacman -Syy packer ssh openssl;;
ubuntu)
sudo apt update
sudo apt --yes install curl openssl postgresql

Expand Down
6 changes: 3 additions & 3 deletions deployments/debian/deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ function bootstrap() {
Linux)
# shellcheck disable=SC2002
local distrib_id
distrib_id=$(head -n 1 </etc/lsb-release 2>/dev/null | \
distrib_id=$(cat /etc/os-release | grep -w ID | \
cut -f2 -d= | tr -d \")

case $distrib_id in
Arch) sudo pacman -Syy dpkg ;;
Ubuntu) ;;
arch) sudo pacman -Syy dpkg ;;
ubuntu) ;;
*)
echo -e "$_error: Boostrapping is currently only supported for Arch and Ubuntu."
exit
Expand Down
50 changes: 50 additions & 0 deletions deployments/native/bootstrap/oraclelinux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/sh
# Copyright 2024 Contributors to the Veraison project.
# SPDX-License-Identifier: Apache-2.0

arch=$(arch)
req_go_version="1.22.0"
install_go="no"
go_pkg=""
step_pkg=""

case $arch in
x86_64)
go_pkg=go1.23.4.linux-amd64.tar.gz
step_pkg=step-cli_amd64.rpm
;;
aarch64)
go_pkg=go1.23.4.linux-arm64.tar.gz
step_pkg=step-cli_arm64.rpm
;;
*)
echo -e "Unsupported architecture for Oracle Linux"
;;
esac

go=$(command -v go)
if [ "$go" == "" ]; then
install_go="yes"
fi

if [ "$install_go" == "no" ]; then
cur_go_version=`go version | { read _ _ cur_go_version _; echo ${cur_go_version#go}; }`
if [ "$(printf '%s\n' "$goversion" "req_go_version" | sort -V | head -n1)" != "req_go_version" ]; then
install_go="yes"
fi
fi

if [ "$install_go" == "yes" ]; then
wget https://go.dev/dl/$go_pkg -O /tmp/$go_pkg
sudo tar -C /usr/local -xzf /tmp/$go_pkg
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go
sudo ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt
fi

sudo dnf install -y --enablerepo=ol9_codeready_builder git protobuf protobuf-devel gettext sqlite openssl jq
sudo dnf install -y https://dl.smallstep.com/cli/docs-cli-install/latest/$step_pkg

go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
go install github.com/mitchellh/protoc-gen-go-json@latest

9 changes: 5 additions & 4 deletions deployments/native/deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,14 @@ function bootstrap() {
case $( uname -s ) in
Linux)
# shellcheck disable=SC2002
local distrib_id=$(cat /etc/lsb-release 2>/dev/null | head -n 1 | cut -f2 -d= | tr -d \")
local distrib_id=$(cat /etc/os-release | grep -w ID | cut -f2 -d= | tr -d \")

case $distrib_id in
Arch) ${BOOTSTRAP_DIR}/arch.sh;;
Ubuntu) ${BOOTSTRAP_DIR}/ubuntu.sh;;
arch) ${BOOTSTRAP_DIR}/arch.sh;;
ubuntu) ${BOOTSTRAP_DIR}/ubuntu.sh;;
ol) ${BOOTSTRAP_DIR}/oraclelinux.sh;;
*)
echo -e "$_ERROR: Boostrapping is currently only supported for Arch and Ubuntu. For other systems, please see one of the scripts in ${BOOTSTRAP_DIR}, and adapt the commmand to your system."
echo -e "$_ERROR: Boostrapping is currently only supported for Arch, Ubuntu and Oracle Linux. For other systems, please see one of the scripts in ${BOOTSTRAP_DIR}, and adapt the commmand to your system."
exit
;;
esac
Expand Down

0 comments on commit 1fdc24a

Please sign in to comment.