about summary refs log tree commit diff
path: root/pkgs/applications/office
diff options
context:
space:
mode:
authorJames Kay <james@hadean.com>2018-04-20 16:20:45 +0100
committerJames Kay <james@hadean.com>2018-04-20 19:01:35 +0100
commitcf351f6389eaf83f7122285389e9958110fe9da2 (patch)
tree5a13d45b1644f713f69c3c8a0fa63933a7c480d6 /pkgs/applications/office
parentec569fc482a445b262386000aef52a9b3ce078a7 (diff)
downloadnixlib-cf351f6389eaf83f7122285389e9958110fe9da2.tar
nixlib-cf351f6389eaf83f7122285389e9958110fe9da2.tar.gz
nixlib-cf351f6389eaf83f7122285389e9958110fe9da2.tar.bz2
nixlib-cf351f6389eaf83f7122285389e9958110fe9da2.tar.lz
nixlib-cf351f6389eaf83f7122285389e9958110fe9da2.tar.xz
nixlib-cf351f6389eaf83f7122285389e9958110fe9da2.tar.zst
nixlib-cf351f6389eaf83f7122285389e9958110fe9da2.zip
atlassian-cli: init at 7.8.0
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r--pkgs/applications/office/atlassian-cli/default.nix31
-rwxr-xr-xpkgs/applications/office/atlassian-cli/wrapper.sh20
2 files changed, 51 insertions, 0 deletions
diff --git a/pkgs/applications/office/atlassian-cli/default.nix b/pkgs/applications/office/atlassian-cli/default.nix
new file mode 100644
index 000000000000..a56c15bffb2a
--- /dev/null
+++ b/pkgs/applications/office/atlassian-cli/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchzip, jre }:
+stdenv.mkDerivation {
+  name = "atlassian-cli";
+  version = "7.8.0";
+  src = fetchzip {
+    url            = https://bobswift.atlassian.net/wiki/download/attachments/16285777/atlassian-cli-7.8.0-distribution.zip;
+    sha256         = "111s4d9m6vxq8jwh1d6ar1f4n5zmyjg7gi2vl3aq63kxbfld9vw7";
+    extraPostFetch = "chmod go-w $out";
+  };
+  tools = [ "agile" "bamboo" "bitbucket" "confluence" "csv"
+    "hipchat" "jira" "servicedesk" "structure" "tempo" "trello" "upm" ];
+  installPhase = ''
+    mkdir -p $out/{bin,share/doc/atlassian-cli}
+    cp -r lib $out/share/java
+    cp -r README.txt license $out/share/doc/atlassian-cli
+    for tool in $tools
+    do
+      substitute ${./wrapper.sh} $out/bin/$tool \
+        --subst-var out \
+        --subst-var-by jre ${jre} \
+        --subst-var-by tool $tool
+      chmod +x $out/bin/$tool
+    done
+  '';
+  meta = with stdenv.lib; {
+    description = "An integrated family of CLI’s for various Atlassian applications";
+    homepage    = https://bobswift.atlassian.net/wiki/spaces/ACLI/overview;
+    maintainers = [ maintainers.twey ];
+    license     = [ licenses.unfreeRedistributable ];
+  };
+}
diff --git a/pkgs/applications/office/atlassian-cli/wrapper.sh b/pkgs/applications/office/atlassian-cli/wrapper.sh
new file mode 100755
index 000000000000..80b60dbc468c
--- /dev/null
+++ b/pkgs/applications/office/atlassian-cli/wrapper.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+tool=@tool@
+user=ATLASSIAN_${tool^^}_USER
+host=ATLASSIAN_${tool^^}_HOST
+pass=ATLASSIAN_${tool^^}_PASS
+
+[ -f ~/.atlassian-cli ] && source ~/.atlassian-cli
+if [ x = ${!user-x} ] || [ x = ${!host-x} ] || [ x = ${!pass-x} ]
+then
+    >&2 echo please define $user, $host, and $pass in '~/.atlassian-cli'
+    exit 1
+fi
+
+@jre@/bin/java \
+    -jar @out@/share/java/@tool@-cli-* \
+    --server "${!host}" \
+    --user "${!user}" \
+    --password "${!pass}" \
+    "$@"