Collaborating on a project¶
Many developers can work on a single Hasura project and all the clusters added to it, since all the configuration is in files, managed by git. A project owner can share their project git repository and add collaborators to the clusters through Hasura Dashboard.
Adding collaborators to your project¶
Assuming you already have a Hasura project and clusters,
- Push your project to an online git repository (like GitHub) and share the URL with all collaborators to share the project source code
- Open the Hasura Dashboard
- Click on a cluster name that is added to the project
- Click on the
Collaborators
tab - Add emails of those who you want to add as collaborators to give access to the cluster
- Repeat for any other clusters
Joining as a collaborator to a project¶
Assuming the owner has shared the repo URL and added you as a collaborator to the clusters,
Login using Hasura CLI with the account having email added as collaborator
Clone the project source code from the repository link shared by the owner and
cd
into the repoExecute hasura cluster list
You should be able to see the clusters available to you and clusters added to the project
For each cluster added to the project, make sure it is listed as available with the actual owner’s email. If not, request the owner to check your email address
Setup the project:
# this command will fetch credentials, adds your ssh key to each cluster and sets up hooks and remotes $ hasura setup
Note
This command is only available in this form from Hasura CLI v0.2.37 onwards.
You can now access these clusters
$ hasura cluster status -c [cluster-alias]
Set a cluster as default
$ hasura cluster set-default [cluster-alias]
Make changes and push
$ git add [file] && git commit -m "[message]" $ git push [cluster-alias] master # you might need to force push (using --force) if two collaborators are pushing simultaneously to same cluster
Note
The owner and collaborators should push changes to the upstream origin (like GitHub) and pull changes regularly to avoid conflicts arising later.