magento-cloud: init at 1.46.1

+59
+53
pkgs/by-name/ma/magento-cloud/package.nix
···
··· 1 + { 2 + lib, 3 + stdenvNoCC, 4 + fetchurl, 5 + makeBinaryWrapper, 6 + php, 7 + testers, 8 + }: 9 + stdenvNoCC.mkDerivation (finalAttrs: { 10 + pname = "magento-cloud"; 11 + version = "1.46.1"; 12 + 13 + src = fetchurl { 14 + url = "https://accounts.magento.cloud/sites/default/files/magento-cloud-v${finalAttrs.version}.phar"; 15 + hash = "sha256-QrrD5pz6Juov1u3QYcuLr6aEKe/4DX5wFKs+hp6KjJ8="; 16 + }; 17 + 18 + dontUnpack = true; 19 + dontBuild = true; 20 + dontConfigure = true; 21 + 22 + nativeBuildInputs = [ makeBinaryWrapper ]; 23 + 24 + installPhase = '' 25 + runHook preInstall 26 + 27 + mkdir -p $out/bin 28 + install -D ${finalAttrs.src} $out/libexec/magento-cloud/magento-cloud.phar 29 + makeWrapper ${lib.getExe php} $out/bin/magento-cloud \ 30 + --add-flags "$out/libexec/magento-cloud/magento-cloud.phar" 31 + 32 + runHook postInstall 33 + ''; 34 + 35 + passthru = { 36 + updateScript = ./update.sh; 37 + tests.version = testers.testVersion { 38 + package = finalAttrs.finalPackage; 39 + command = "HOME=$TMPDIR magento-cloud --version"; 40 + }; 41 + }; 42 + 43 + meta = { 44 + homepage = "https://experienceleague.adobe.com/en/docs/commerce-cloud-service/user-guide/dev-tools/cloud-cli/cloud-cli-overview"; 45 + description = "Adobe Commerce Cloud CLI"; 46 + longDescription = '' 47 + Adobe Commerce Cloud CLI enables developers and system administrators the ability to manage Cloud projects and environments, perform routines and run automation tasks locally. 48 + ''; 49 + mainProgram = "magento-cloud"; 50 + maintainers = with lib.maintainers; [ piotrkwiecinski ]; 51 + license = lib.licenses.unfree; 52 + }; 53 + })
+6
pkgs/by-name/ma/magento-cloud/update.sh
···
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell --pure -i bash -p bash curl jq nix-update cacert git 3 + set -euo pipefail 4 + 5 + new_version="$(curl https://accounts.magento.cloud/cli/manifest.json | jq --raw-output .[0].version)" 6 + nix-update magento-cloud --version "$new_version"