Recently I made a post requesting for help, and also another person as I see today. This days i had been working with this lab and apply many solutions that for my perspective, it seems fine. But for some reason not for the lab. Can you check if this lab is working right ? It seems that when you finally made the push, the tag didn’t work by the hook. I quite sure that what I’m doing should be fine, so please can you review this lab ? Thanks in advance!
!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to "post-update".
var1="release-"
var1+=$(date --rfc-3339=date)
git tag $var1
Then a edit the script name to post-update using mv
After that:
Hi @mmkmou . Thanks for the info, but I still don’t understand how to implement the bare repo. I tried many things, like changing the config file in .git, and setting the variable bare to true. Also I tried to create a empty bare repo, but I never could be able to linked the bare repo with the non bare repo in master branch. I checked this using git remote -v. Can you explain me how to link the bare repo with the non bare repo, in order to be able to run the hook script ?
Not yet, the last weeks I’m been studying the Kubernetes administrator course, but I think in the next couple of days I will return to find the solution.
As far as I know you need to implement the git hook in the bare repo, the /opt/iCantRememberTheRouteOfTheRepoWellEnough and not in the cloned repo, where the branch feature is. I think [maybe] I will check this lab in this weekend, I’m close to finish the CKA course, after that I will check the engineer plataform, because I want to finish the git labs to start the kubernetes. But when I’ll make it I will let you know if you like.
Hi @mmkmou
Could you please advise how to do accomplish this as it is a bare repo and you are saying to do manipulation on bare repo folder? Please provide us with the steps to complete this task. Hoping to get a solution from your end.
It would be nice to know how to finish this lab, it seems many people are having trouble to solving this. I’m not getting yet in the engineer plataform because I’m focusing my study in getting the labs from the CKA course and exams well enough. But the last time I tried to accomplish this, I’m unable to do it, not sure if i try again I’ll succeed
ssh [email protected]
cd /usr/src/kodekloudrepos/media/
sudo git checkout master
sudo git merge feature
sudo touch /opt/media.git/hooks/post-update
sudo chmod +x /opt/media.git/hooks/post-update
sudo vi /opt/media.git/hooks/post-update
#!/bin/bash
cd /opt/media.git
git_tag=release-$(date "+%Y-%m-%d")
git tag $git_tag
sudo git push
You must make hook on git repo host. In this case in git repo dir on the same host.
…
For git merge lab:
ssh [email protected]
cd ./story-blog/
git push (see error)
git pull (one file not merged)
vi ./story-index.txt
Edit this:
<<<<<<< HEAD
1. The Lion and the Mooose
2. The Frogs and the Ox
3. The Fox and the Grapes
4. The Donkey and the Dog
=======
1. The Lion and the Mouse
2. The Frogs and the Ox
3. The Fox and the Grapes
>>>>>>> ea1b54b88551502f5e6f60b9a74452a29bf2d09f
To this:
1. The Lion and the Mouse
2. The Frogs and the Ox
3. The Fox and the Grapes
4. The Donkey and the Dog
Make a commint:
git add .
git commit
git push
Hi @carlos140
You must create the hook under the origin/bare repository, for example as per the below screenshot, the hook should be created under /opt/news.git/hooks/
Thanks for let me know. Currently now I’m having to do a lot of tasks, so today maybe not, but during the week I’ll try. I’ll let you know if I succeed.