-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OPSEXP-3019 Refactor install-ubuntu-default-tools to remove unrelated…
… steps (#876)
- Loading branch information
Showing
4 changed files
with
30 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,35 @@ | ||
name: "Install Ubuntu default tools" | ||
description: "Install common Ubuntu tools (e.g.: docker, git, zip, unzip, python3)" | ||
description: "Install common Ubuntu tools (e.g.: docker, git, zip, unzip)" | ||
inputs: | ||
packages: | ||
description: "The list of package names to be installed separated by a whitespace" | ||
required: false | ||
sudo: | ||
description: "Whether to use sudo or not" | ||
required: false | ||
default: "true" | ||
runs: | ||
using: composite | ||
steps: | ||
- name: "Install common tools" | ||
shell: bash | ||
run: | | ||
if [ "${{ inputs.sudo }}" = "true" ]; then | ||
SUDO="sudo" | ||
else | ||
SUDO="" | ||
fi | ||
$SUDO apt-get update | ||
$SUDO apt-get install -y ca-certificates curl gnupg git zip unzip ${{ inputs.packages }} | ||
# Install Docker as per https://docs.docker.com/engine/install/ubuntu/ | ||
apt-get update | ||
apt-get install ca-certificates curl gnupg -y | ||
install -m 0755 -d /etc/apt/keyrings | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg | ||
chmod a+r /etc/apt/keyrings/docker.gpg | ||
$SUDO install -m 0755 -d /etc/apt/keyrings | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | $SUDO gpg --dearmor -o /etc/apt/keyrings/docker.gpg | ||
$SUDO chmod a+r /etc/apt/keyrings/docker.gpg | ||
echo \ | ||
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | ||
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ | ||
tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
apt-get update | ||
# Additionally install git, zip and unzip, python3 | ||
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin git zip unzip python3 python3-pip ${{ inputs.packages }} -y | ||
# Allow usage of "docker-compose" rather than "docker compose" in bash scripts | ||
ln -f -s /usr/libexec/docker/cli-plugins/docker-compose /usr/local/bin/docker-compose | ||
# Workaround due to $HOME not being set causing issues with settings.xml installation in setup-build-java | ||
mkdir -p /root/.m2 | ||
cp .ci.settings.xml /root/.m2/settings.xml | ||
$SUDO tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
$SUDO apt-get update | ||
$SUDO apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v8.9.1 | ||
v8.10.0 |