GIT¶
GIT - is an open source, distributed version control system.
Warning
The repository server address depends on the server number. For server s0.serv00.com
will be the address repo0.serv00.com
, for server s1.serv00.com
- repo1.serv00.com
, for server s2.serv00.com
- repo2.serv00.com
etc. The examples use the address repoX.serv00.com
DevilWEB¶
After logging in to the hosting account panel repository management can be found in the Repositories
tab. After clicking, a list of repositories is shown. To add a repository choose + Add repository
, then select Repository type
and Visibility
and click + Add
.
Devil¶
Configuring the GIT repository is also possible from SHELL using the devil repo
module.
Adding and removing repositories¶
Adding a repository is done with the command devil repo repository add git REPO_NAME VISIBILITY
, where the arguments are:
REPO_NAME
- repository nameVISIBILITY
- visibility:pub
(public) orpriv
(private)
The repository will be available with HTTP protocol at: https://repoX.serv00.com/git/VISIBILITY/LOGIN/REPO_NAME/
and SSH protocol: ssh://LOGIN@repoX.serv00.com:~/repo/git/VISIBILITY/REPO_NAME/
Deleting the repository is done with the command: devil repo repository del git REPO_NAME
. To list the repositories, use the devil repo list
command.
Repository modification¶
Changing the visibility of the repository is done with the command devil repo repository change git REPO_NAME VISIBILITY
Adding and removing users¶
Adding user accounts is done with the command devil repo account add git REPO_NAME USERNAME
, where the arguments are:
REPO_NAME
- repository nameUSERNAME
- login of the repository user
Deleting an account is done with the command devil repo account del git REPO_NAME USERNAME
. To list repository users, use the command: devil repo list git REPO_NAME
Password change¶
Changing the user's password is done with the command: devil repo account passwd git REPO_NAME USERNAME
Hooks¶
In order to use the hooks
functionality, you need to unlock the ability to execute binaries at the hosting account which is blocked by default.
Publication of the website¶
The mechanism of hooks can be used to publish websites.
- Create git repository
- Create a repository user account
- Create a
hooks/post-receive
file with the content:
#!/bin/sh
unset GIT_INDEX_FILE
export DOMAIN=#ENTER DOMAIN NAME HERE
export PUBLIC=#ENTER THE NAME OF THE DIRECTORY WITH THE PAGE HERE, THE NAME DEPENDS ON THE TYPE OF THE PAGE
export LOGIN=#ENTER YOUR LOGIN HERE
export VISIBILITY=#pub OR priv
export REPONAME=#ENTER REPOSITORY NAME HERE
export GIT_WORK_TREE="/usr/home/$LOGIN/domains/$DOMAIN/$PUBLIC/"
export GIT_DIR="/usr/home/$LOGIN/repo/git/$VISIBILITY/$REPONAME/"
/usr/local/bin/git checkout -f
- Set the right perimission for the file with command:
chmod +x post-receive
- Clone the website repository locally
- Make changes to files
- Do a
git commit
- Push changes to the parent repository
- Any subsequent changes to the files of the website must be made only on the exact cloned locally from the Serv00.com repository - not directly from the domain directory - and then push them to the server.