From 5ede9347d35d5437fd9b5c626e5ad3fdfb38320f Mon Sep 17 00:00:00 2001 From: Jacob Hummer Date: Thu, 17 Aug 2023 14:30:02 -0500 Subject: [PATCH 1/4] Update test-feature.yml --- .github/workflows/test-feature.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-feature.yml b/.github/workflows/test-feature.yml index 3171f4a..0ad58fc 100644 --- a/.github/workflows/test-feature.yml +++ b/.github/workflows/test-feature.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - includes: + include: - image: mcr.microsoft.com/devcontainers/base:ubuntu options: '{ "bazelisk_version": "1.17.0" }' - image: debian:bookworm-slim From 1cb88a76e87243657787ac2a8b0d149d7dea7d41 Mon Sep 17 00:00:00 2001 From: Jacob Hummer Date: Thu, 17 Aug 2023 14:55:02 -0500 Subject: [PATCH 2/4] Create lib.sh --- lib.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib.sh diff --git a/lib.sh b/lib.sh new file mode 100644 index 0000000..f1e3ac2 --- /dev/null +++ b/lib.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# https://github.com/devcontainers/features/blob/9fd5daf06b40794a067c4cdbb8e258d99eeefc24/src/node/install.sh +apt_get_update() { + if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then + echo "Running apt-get update..." + apt-get update -y + fi +} + +# https://github.com/devcontainers/features/blob/9fd5daf06b40794a067c4cdbb8e258d99eeefc24/src/node/install.sh +# Checks if packages are installed and installs them if not +check_packages() { + if ! dpkg -s "$@" > /dev/null 2>&1; then + apt_get_update + apt-get -y install --no-install-recommends "$@" + fi +} From 923e31f83b492ad8fb530779d44411112f1d6b09 Mon Sep 17 00:00:00 2001 From: Jacob Hummer Date: Thu, 17 Aug 2023 14:55:34 -0500 Subject: [PATCH 3/4] Update install.sh --- install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install.sh b/install.sh index 47bbc09..f7894d5 100644 --- a/install.sh +++ b/install.sh @@ -1,5 +1,8 @@ #!/bin/bash set -eu +source lib.sh + +check_packages curl ca-certificates echo "Installing Bazel" From beb6a332b71c5d1197b9b7b2b3811ff5aa56134d Mon Sep 17 00:00:00 2001 From: Jacob Hummer Date: Thu, 17 Aug 2023 15:22:41 -0500 Subject: [PATCH 4/4] Update devcontainer-feature.json --- devcontainer-feature.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devcontainer-feature.json b/devcontainer-feature.json index c62d1c7..498147d 100644 --- a/devcontainer-feature.json +++ b/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "Bazel", "id": "bazel", - "version": "1.0.0", + "version": "1.1.0", "description": "Bazel feature", "options": { "bazelisk_version": {