From a6b441913273b2fe8ba5a41549cb261e89a03075 Mon Sep 17 00:00:00 2001 From: Mathias Elle Date: Mon, 28 Oct 2024 00:48:00 +0100 Subject: [PATCH] Update DDEV addon command to use ddev add-on get (#53) Update commands and tests to use `ddev add-on get` instead of `ddev get`. * **commands/host/frontend-update** - Change `ddev get` to `ddev add-on get` for fetching the latest version of the addon. * **install.yaml** - Update pre-install actions to use `ddev add-on get` instead of `ddev get`. * **tests/test.bats** - Modify installation tests to use `ddev add-on get` instead of `ddev get`. * **CHANGELOG.md** - Add an entry to document the update to use `ddev add-on get` for versions of DDEV prior to v1.23.5. --- CHANGELOG.md | 2 ++ commands/host/frontend-update | 4 ++-- install.yaml | 2 +- tests/test.bats | 8 ++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a206f8..decd099 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file. ## UNRELEASED 1.9.0 +- Updated to use `ddev add-on get` for versions of DDEV prior to v1.23.5 + --- ## Latest Release diff --git a/commands/host/frontend-update b/commands/host/frontend-update index 82b488a..99dfbcf 100644 --- a/commands/host/frontend-update +++ b/commands/host/frontend-update @@ -10,7 +10,7 @@ LATEST_WOODOO_VERSION=$(curl -s https://api.github.com/repos/dermatz/ddev-woodoo-buildtools-magento/releases/latest | grep tag_name | cut -d '"' -f 4) if [[ $1 == "-dev" ]]; then - ddev get https://github.com/dermatz/ddev-woodoo-buildtools-magento/archive/refs/heads/main.tar.gz + ddev add-on get https://github.com/dermatz/ddev-woodoo-buildtools-magento/archive/refs/heads/main.tar.gz else - ddev get https://github.com/dermatz/ddev-woodoo-buildtools-magento/archive/refs/tags/"${LATEST_WOODOO_VERSION}".tar.gz + ddev add-on get https://github.com/dermatz/ddev-woodoo-buildtools-magento/archive/refs/tags/"${LATEST_WOODOO_VERSION}".tar.gz fi diff --git a/install.yaml b/install.yaml index 63408ef..893db1d 100644 --- a/install.yaml +++ b/install.yaml @@ -2,7 +2,7 @@ name: ddev-woodoo-buildtools-magento pre_install_actions: # https://github.com/Morgy93/ddev-gum - - if ! ddev get --installed | grep -q "Morgy93/ddev-gum"; then ddev get Morgy93/ddev-gum; fi + - if ! ddev add-on get --installed | grep -q "Morgy93/ddev-gum"; then ddev add-on get Morgy93/ddev-gum; fi - "if [ -f .ddev/commands/web/woodoo_components/checks ]; then rm .ddev/commands/web/woodoo_components/checks && echo 'Woodoo Housekeeping: removed old file .ddev/commands/web/woodoo_components/checks'; fi" project_files: diff --git a/tests/test.bats b/tests/test.bats index 6fc3362..6bf983c 100644 --- a/tests/test.bats +++ b/tests/test.bats @@ -26,8 +26,8 @@ teardown() { @test "install from directory" { set -eu -o pipefail cd ${TESTDIR} - echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3 - ddev get ${DIR} + echo "# ddev add-on get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3 + ddev add-on get ${DIR} ddev restart health_checks } @@ -35,8 +35,8 @@ teardown() { @test "install from release" { set -eu -o pipefail cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 ) - echo "# ddev get ${DDEV_ADDON} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3 - ddev get ${DDEV_ADDON} + echo "# ddev add-on get ${DDEV_ADDON} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3 + ddev add-on get ${DDEV_ADDON} ddev restart >/dev/null health_checks }