Skip to content

Commit

Permalink
Update DDEV addon command to use ddev add-on get (#53)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dermatz authored Oct 27, 2024
1 parent 9e37cc3 commit a6b4419
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions commands/host/frontend-update
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions tests/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ 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
}

@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
}

0 comments on commit a6b4419

Please sign in to comment.