Welcome to the Geekhaven FOSS recruitment challenge! We're excited to see how you tackle the tasks and demonstrate your GitHub, SSH, and scripting skills. Read carefully and execute your tasks with precision.
Your goal is to:
- Manage GitHub repositories and permissions.
- Utilize Git hooks to validate commits.
- Work with SSH keys and deploy keys.
- Override commit authorship.
- Test your tasks with Bash scripts.
- As a bonus, integrate GitHub Actions to automate workflow tasks.
- Create a private repository on GitHub.
- Add the following GitHub IDs as collaborators:
bhupesh98
VatsalBhuva11
- Perform a couple of commits by pushing any of your previous project files to this new repository under the main branch.
- Create a pre-commit hook that logs the last 5 commands you run in a file named
task_commands.sh
in the repository. - Make sure this file is not tracked by Git.
- Push this hook to the repository under the folder
hooks
and try it out. - Create a post-commit hook that logs the commit message and author details in a file named
commit_details.txt
in the repository. - Make sure this file is not tracked by Git.
- Push this hook to the repository under the folder
hooks
. - At the end of the task,remove these hooks & commit these two files created by hooks inside the
hooks
folder.
- Logout from GitHub on the machine youβre working on and the repository locally.
- Generate Public and Private SSH Keys using OpenSSH CLI tools. Name these files as
deploy_key.pub
&deploy_key
. - Configure Deploy Keys on your repository with the following permissions:
- Read
- Write
- Clone your repository using the SSH URL. It is recommended to configure your SSH config file to use the generated SSH key. Here is an example of how you can do it:
Host $YOUR_REPO_NAME
HostName github.com
User git
IdentityFile /path/to/your/private/key
- Create a new branch and switch to it.
- Override some previous commits by changing the author name and email (use any desired nickname and alternate email).
- Push these changes back to your private repository under this new branch.
Create another Bash script that tests whether the tasks perfornmed above are successfully executed. Make sure include fun and colorful outputs using ANSI color codes:
- Use blue for informational messages.
- Use yellow for warnings.
- Use green for success messages.
- Use red for errors.
Configure a simple GitHub Actions workflow in your private repository. This workflow should use linting tools like shellcheck
to check for errors in your scripts & set conditions to only run on desired branch.
As part of the fun, you can enhance your GitHub Actions workflow by adding custom, colorful output messages when running shellcheck
workflow. This will make your workflow more engaging and help differentiate between errors, warnings, and success messages, just like you did with the Bash script. This will be simple messages based on exit code of the shellcheck commands.
Create a JSON file containing your details. The JSON file should include:
- Your Name
- Your Roll Number
- Your Email
- The link to your private GitHub repository
Also, push an image to your repository where all the tasks have been verified by your tester bash script.
Warning
Please keep your public key
and private key
in .gitignore
file, as you must totally avoid commiting these files in your github repository. But these files must be present locally when executing the test script.
-
Name your files as follows:
- The script where commands were being logged:
task_commands.sh
- The testing script:
task_tester.sh
- The information JSON file:
info.json
- The GitHub Actions workflow file:
.github/workflows/task_workflow.yml
- The image file:
result.png
. - Public key:
deploy_key.pub
- Private key:
deploy_key
- The script where commands were being logged:
-
Create a pull request on this repository on the main branch where you must make a folder with name as your Enrollment Number. Under that, there should be your
info.json
file.
Make sure your submission is neat and follows the required file names and structure. Any deviation might cost you valuable points in this competitive task!
- Do NOT share or expose your SSH keys or other sensitive data publicly.
- Your private repository should have proper collaborator permissions for the IDs mentioned above.
- Make sure your Bash script runs seamlessly on any standard Linux/Unix environment.
- Pay attention to detail and ensure everything is automated as per the requirements.
- Do not use AI tools for completion of this task. We are looking for your skills and not the AI's. We know most of you might not have heard some of these tooling before, but that's the point of this task. To learn and implement new things. Learn concepts (here your AI might help you) and implement them on your own.
Weβre looking forward to seeing your submissions! Best of luck and have fun with this challenge. πΎ Shall you have any doubts, feel free to contact either of the organizers to resolve them. Irrelevant doubts will not be entertained/will be ignored. You should try resolving them on your own first, and only if the solution is not immediately obvious or found to you, only then contact us. (@bhupesh98 , @VatsalBhuva11).