How can I know the repository path on linux?
I choiced "/var/atlassian/stash/data/repositories" as repository root path.
Then I created some projects and repositories.
Now I want to edit hook script, but I cannot know the target repository's path.
(Some numbering directory(1, 2, 3... not project and repository name) exist in repositries directory)
environment:
To help mitigate this issue we've created a plugin for Stash, the Repository System Info Plugin. It allows system administrators to view the location on disk of the repository through the Stash UI.
EDIT: As of 2.7 you can view this information on the repository settings page.
Is there a way to access the location via calling the plugin in Hook code? trying to get the repository directory from the post recieve hook to modify a file in the Hook code.
Cheers,
Sameer Jaffer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
There is currently no way in Stash to determine where a repository lives on disk without peeking into the database and looking at the repository id.
There is an open feature request to make repositories on disk easier to find.
https://jira.atlassian.com/browse/STASH-2552
Thanks,
Seb
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Since Stash 2.1, the repository id is also returned from the REST API.
curl -u admin:admin -X GET http://localhost:7990/stash/rest/api/latest/projects/PROJECT_1/repos/rep_1
Will now return:
{ "slug":"rep_1", "id":1, "name":"rep_1", "scmId":"git", "state":"AVAILABLE", "statusMessage":"Available", "project":{ "key":"PROJECT_1", "id":1, "name":"Project 1", "description":"Default configuration project #1", "isPersonal":false, "link":{"url":"/projects/PROJECT_1","rel":"self"} }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The above url did not work for me, but http://localhost:7990/stash/rest/api/latest/projects/PROJECT_1/repos/rep_1 gave output aproximately as above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The following did not work for me. Any clue ?
curl -u username:password -X GET http://localhost:7990/stash/rest/api/latest/projects/U3SI/repos/repo/dom-2010
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looks like the URL I provided had an extra /repo/ in the path that shouldn't have been there. I've fixed my comment with the correct URL.
Try
curl -u username:password -X GET http://localhost:7990/stash/rest/api/latest/projects/U3SI/repos/dom-2010
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would say the numbers relate to the repository id internally in stash.
You might have to use the stash REST API to find the repository id out though
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Which api do I need to use in https://developer.atlassian.com/static/rest/stash/1.1.2.html ?
I tried to use "http://example.com/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug} ", but I couldn't get the repository id.
-----
curl -u xxx:xxx -X GET -H "Content-Type: application/json" http://localhost:7990/stash/rest/api/1.0/projects/TEST/repos/repo
{"slug":"repo","name":"REPO","type":"GIT","state":"AVAILABLE","statusMessage":"Available","cloneUrl":"https://xxx@xxx/stash/scm/TEST/repo.git","project":null,"link":{"url":"/projects/TEST/repos/repo/browse","rel":"self"}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Compare the directories in refs/heads to what you see in Stash GUI. If needed, dig a little deeper and compare the commit hash to last commit in Stash GUI.
Example: given a path <stash_home>/data/repositories/<some #>/refs/heads,
run ls to obtain a dir listing
compare output to Stash GUI Repository by clicking Repositories at top, by default it shows Files. Then click the directory drop down button directly underneath to show all dirs.
If your projects use a similar directory layout --
run less against one of the files listed using ls earlier.
compare hash against Stash GUI by clicking Commits (next to Files.) Usually the short code listed is fine, but you can click on it to obtain the full hash.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.