summaryrefslogtreecommitdiffstats
path: root/pkgs/misc/platformsh
diff options
context:
space:
mode:
authorSoner Sayakci <s.sayakci@shopware.com>2022-04-24 08:28:18 +0000
committerSoner Sayakci <s.sayakci@shopware.com>2022-04-24 08:40:25 +0000
commit0d92d898ed0baba5195b8dee0d4d45ed8dbb76cf (patch)
tree488a6268d47e5156e23a1cdf7590c3fbbd1df906 /pkgs/misc/platformsh
parent347647008b6366890bf013aa3098a50f4faeffc4 (diff)
platformsh: init at v3.78.0
Diffstat (limited to 'pkgs/misc/platformsh')
-rw-r--r--pkgs/misc/platformsh/default.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/pkgs/misc/platformsh/default.nix b/pkgs/misc/platformsh/default.nix
new file mode 100644
index 000000000000..e2bb1f3367a9
--- /dev/null
+++ b/pkgs/misc/platformsh/default.nix
@@ -0,0 +1,50 @@
+{ stdenv, fetchurl, makeWrapper, writeShellScript, lib, php, curl, jq, common-updater-scripts }:
+
+let
+ pname = "platformsh";
+ version = "v3.78.0";
+in
+stdenv.mkDerivation {
+ inherit pname version;
+
+ src = fetchurl {
+ url = "https://github.com/platformsh/platformsh-cli/releases/download/${version}/platform.phar";
+ sha256 = "sha256-2EasMsZIwplkl1S5PH0Y3gRymAIdpiFgVc3pNPiFg1o=";
+ };
+
+ dontUnpack = true;
+
+ nativeBuildInputs = [ makeWrapper ];
+
+ installPhase = ''
+ runHook preInstall
+ mkdir -p $out/bin
+ install -D $src $out/libexec/platformsh/platform.phar
+ makeWrapper ${php}/bin/php $out/bin/platform \
+ --add-flags "$out/libexec/platformsh/platform.phar"
+ runHook postInstall
+ '';
+
+ passthru = {
+ updateScript = writeShellScript "update-${pname}" ''
+ set -o errexit
+ export PATH="${lib.makeBinPath [ curl jq common-updater-scripts ]}"
+ NEW_VERSION=$(curl -s https://api.github.com/repos/platformsh/platformsh-cli/releases/latest | jq .tag_name --raw-output)
+
+ if [[ "${version}" = "$NEW_VERSION" ]]; then
+ echo "The new version same as the old version."
+ exit 0
+ fi
+
+ update-source-version "platformsh" "$NEW_VERSION"
+ '';
+ };
+
+ meta = with lib; {
+ description = "The unified tool for managing your Platform.sh services from the command line.";
+ license = licenses.mit;
+ homepage = "https://github.com/platformsh/platformsh-cli";
+ maintainers = with maintainers; [ shyim ];
+ platforms = platforms.all;
+ };
+}