-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve scripts for performance testing #2036
- Loading branch information
Showing
2 changed files
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/sh | ||
sed -i -e "s/postgres/$USER/" /tmp/dataverse_db.sql | ||
sed -i -e 's/dvnapp/dataverse_app/' /tmp/dataverse_db.sql | ||
sed -i -e 's/dvn-vm7.hmdc.harvard.edu:8983/localhost:8983/' /tmp/dataverse_db.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
#!/bin/sh | ||
SERVER=staging.dataverse.org | ||
SERVER=http://localhost:8080 | ||
DATAVERSE=togo | ||
USERID="@pdurbin" | ||
ROLE=admin | ||
|
||
echo "Assigning $ROLE to $USERID on $DATAVERSE..." | ||
OUT_ASSIGN=`time curl -s -X POST -H "Content-type:application/json" -d "{\"assignee\": \"$USERID\",\"role\": \"$ROLE\"}" "https://$SERVER/api/dataverses/$DATAVERSE/assignments?key=$API_TOKEN"` | ||
OUT_ASSIGN=`time curl -s -X POST -H "Content-type:application/json" -d "{\"assignee\": \"$USERID\",\"role\": \"$ROLE\"}" "$SERVER/api/dataverses/$DATAVERSE/assignments?key=$API_TOKEN"` | ||
echo $OUT_ASSIGN | jq '.data | {assignee,_roleAlias}' | ||
|
||
echo "Retrieving ID of role to revoke..." | ||
ASSIGNMENTS=`time curl -s "https://$SERVER/api/dataverses/$DATAVERSE/assignments?key=$API_TOKEN"` | ||
ASSIGNMENTS=`time curl -s "$SERVER/api/dataverses/$DATAVERSE/assignments?key=$API_TOKEN"` | ||
echo $ASSIGNMENTS | jq ".data[] | select(.assignee==\"$USERID\") | ." | ||
|
||
echo "Revoking $ROLE from $USERID on $DATAVERSE..." | ||
ID_TO_REVOKE=`echo $ASSIGNMENTS | jq ".data[] | select(.assignee==\"$USERID\") | .id"` | ||
OUT_REVOKE=`time curl -s -X DELETE "https://$SERVER/api/dataverses/$DATAVERSE/assignments/$ID_TO_REVOKE?key=$API_TOKEN"` | ||
OUT_REVOKE=`time curl -s -X DELETE "$SERVER/api/dataverses/$DATAVERSE/assignments/$ID_TO_REVOKE?key=$API_TOKEN"` | ||
echo $OUT_REVOKE | jq '.data.message' |