The repo contains the source code for GymKhana's official website written in PHP, HTML, CSS, SASS and JS.
Below are the minimal steps to get the server running locally on port 8000.
- For the running of the website, you need to install PHP.
- Open terminal and following below instructions.
cd /path/to/folder/with/index.php
php -S 127.0.0.1:8000
Below is the detailed step by step guide on how to get your pushed changes into deployment.
- SSH into the gymkhana server and run
cd /home/gymkhana
. - Do
git remote -v
and verify that the origin points to correct repo. If not, change origin using the following commands:
git remote rm origin
git remote add origin <new_repo_url>
- Run
git fetch origin
- On your local system, run
git diff <commit hash before your changes> <commit hash of head>
. Usegit log
to get commit hashes. - For every new file or folder, do
git checkout origin/master -- path/to/file/or/folder
. The path here should be relative to root of the repository.
This will ensure that all the changes that you have pushed are now deployed. There is no delay in the deployment and the website is updated immediately.
To update blog, visit "http://www.gymkhana.iitkgp.ac.in/blog/wp-admin" and enter the credentials provided in the credentials sheet.
Run sass --watch sass/style.scss:css/style.css --style compressed
This will watch for changes in the sass folder and auto generate css
Run sass --watch sass/blog.scss:gymk/style.css --style compressed
This will watch for changes in the sass folder and auto generate css in the gymk folder.
- Make a folder
gymkhana
in home directory - Mount gymkhana's /beta folder to ~ using
sshfs gymkhana@10.3.100.81:beta /home/xypnox/gymkhana/
so we don't ever disturb the original files. sshfs https://github.com/libfuse/sshfs can be installed using standard apt install sshfs - Then clone the repo there. We just need to git pull in the folder to update the site after we are satisfied with the results
- The files are also available in file browser so they can be edited by system programs (VS Code) but I would recommend editing in the repo only
- After updating the files it is better to unmount using
fusermount -u gymkhana
- note that the git files will dissappear from the folder
gymkhana
. When we need to update just mount > git pull > unmount
- Add more details to readme.md