Skip to content

Commit

Permalink
OPSEXP-3019 Refactor install-ubuntu-default-tools to remove unrelated…
Browse files Browse the repository at this point in the history
… steps (#876)
  • Loading branch information
gionn authored Jan 21, 2025
1 parent 56cf95c commit e87b8c6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 23 deletions.
35 changes: 20 additions & 15 deletions .github/actions/install-ubuntu-default-tools/action.yml
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-yaml
args: [--allow-multiple-documents]
Expand All @@ -13,17 +13,17 @@ repos:
args: ['--fix=lf']
exclude: .github/actions/send-slack-notification/tests/sample-commit-message.txt
- id: end-of-file-fixer
exclude: '.github/actions/dispatch-resume-workflow/dist/*'
exclude: '.*/dist/.*'
- id: trailing-whitespace
exclude: .github/actions/dispatch-resume-workflow/dist/*
exclude: '.*/dist/.*'
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.28.5
rev: 0.31.0
hooks:
- id: check-dependabot
- id: check-github-actions
- id: check-github-workflows
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
rev: v0.43.0
hooks:
- id: markdownlint
- repo: local
Expand Down
6 changes: 4 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Here follows the list of GitHub Actions topics available in the current document
- [load-release-descriptor](#load-release-descriptor)
- [maven-build-and-tag](#maven-build-and-tag)
- [Preview option for maven-build-and-tag](#preview-option-for-maven-build-and-tag)
- [Option to skip tests for maven-build-and-tag](#option-to-skip-tests-for-maven-build-and-tag)
- [maven-deploy-file](#maven-deploy-file)
- [maven-release](#maven-release)
- [maven-update-pom-version](#maven-update-pom-version)
Expand Down Expand Up @@ -936,12 +937,13 @@ Installs and cache ansible galaxy dependencies. When `pipenv` binary exists, ins

### install-ubuntu-default-tools

Install common Ubuntu tools such as docker, git, zip, unzip, python3. Meant to be used on top of self-hosted runners with vanilla ubuntu images.
Install common Ubuntu tools such as docker, git, zip, unzip. Meant to be used on
top of self-hosted runners coming with vanilla ubuntu images or the latest arm64 runners.

```yaml
- uses: Alfresco/alfresco-build-tools/.github/actions/install-ubuntu-default-tools@ref
with:
package-names-list: "postgresql-client"
package-names-list: "postgresql-client" # optional packages to install
```

### jx-updatebot-pr
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v8.9.1
v8.10.0

0 comments on commit e87b8c6

Please sign in to comment.