[GITHUB] SETUP CICD - fourslickz/notes GitHub Wiki
#!/bin/bash
choose environment
set name
# CREATE LOCAL REPOSITORY
mkdir -p /var/www/html/live/be-service-user-level
mkdir -p ~/live/be-service-user-level.live.git
cd ~/live/be-service-user-level.live.git
git init --bare
echo '#!/bin/bash' > ./hooks/post-receive
echo "GIT_WORK_TREE=/var/www/html/live/be-service-user-level git checkout production -f" >> ./hooks/post-receive
chmod 755 ./hooks/post-receive
# CLONE ORIGIN REPOSITORY
cd ~/cicd/master/
git clone [email protected]:IT-RIN-AYOSATU/BE-SERVICE-USER-LEVEL.git
cd ./BE-SERVICE-USER-LEVEL
git remote add bare-repo-live ssh://pramuka@localhost:2244/home/pramuka/live/be-service-user-level.live.git
git fetch origin
git checkout production
git push -u bare-repo-live +production