This is an automated email from the ASF dual-hosted git repository.

abeizn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 9e9f5f7b chore: api request script for github/jira
9e9f5f7b is described below

commit 9e9f5f7bdf7353c1404667506fbab42a590f84ba
Author: Klesh Wong <[email protected]>
AuthorDate: Tue Jul 26 15:09:27 2022 +0800

    chore: api request script for github/jira
---
 scripts/pm/framework/proceed-db-migration.sh |  4 ++--
 scripts/pm/github/user.sh                    |  7 +++++++
 scripts/pm/jira/plugin/connection-create.sh  | 16 ++++++++++++++++
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/scripts/pm/framework/proceed-db-migration.sh 
b/scripts/pm/framework/proceed-db-migration.sh
index d88599ab..abf94764 100755
--- a/scripts/pm/framework/proceed-db-migration.sh
+++ b/scripts/pm/framework/proceed-db-migration.sh
@@ -1,6 +1,6 @@
 
 #!/bin/sh
 
-sh "$(dirname $0)/../vars/active-vars.sh"
+. "$(dirname $0)/../vars/active-vars.sh"
 
-curl -v $LAKE_ENDPOINT/proceed-db-migration | jq
+curl -sv $LAKE_ENDPOINT/proceed-db-migration | jq
diff --git a/scripts/pm/github/user.sh b/scripts/pm/github/user.sh
new file mode 100755
index 00000000..6a476d56
--- /dev/null
+++ b/scripts/pm/github/user.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+. "$(dirname $0)/../vars/active-vars.sh"
+
+curl -sv $GITHUB_ENDPOINT/user \
+    -H "Authorization: Token $GITHUB_TOKEN" \
+    | jq
diff --git a/scripts/pm/jira/plugin/connection-create.sh 
b/scripts/pm/jira/plugin/connection-create.sh
new file mode 100755
index 00000000..6c1d3531
--- /dev/null
+++ b/scripts/pm/jira/plugin/connection-create.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+. "$(dirname $0)/../../vars/active-vars.sh"
+
+jira_endpoint=${1-$JIRA_ENDPOINT}
+jira_username=${2-$JIRA_USERNAME}
+jira_password=${3-$JIRA_PASSWORD}
+
+curl -sv $LAKE_ENDPOINT/plugins/jira/connections --data @- <<JSON | jq
+{
+    "name": "testjira",
+    "endpoint": "$jira_endpoint",
+    "username": "$jira_username",
+    "password": "$jira_password"
+}
+JSON

Reply via email to