You work in the data team at a consulting firm, and one of your team's products is helping companies optimize and manage their cloud hosting expenditures.
Your team has an existing bash script that initializes an analysis directory for each new client.
You've been asked to update this script to also automate the initial organization of data files provided by clients.
- Forking the Repository: If you have not already done so, fork this Shell learning module repository following these instructions.
- Forking creates a copy of the main repository in your GitHub account. This allows you to work on your version without affecting the original repository.
- Create a Branch for Your Work: To keep your changes organized, create a new branch named
assignment
:git checkout -b assignment
- Modify the Script: Using the template in
02_activities/assignments/assignment.sh
, fill in the correct commands as described by the comments.- It may help to paste your commands into the Terminal as you write your script (or vice versa) to test as you go
- Test Your Script Locally: Execute your script to ensure it works as expected. You may need to make additional tweaks and re-run it until you are satisfied with the results.
- Commit Your Changes: As you complete parts of your script and confirmed that it is working correctly, commit your changes to ensure your progress is saved.
git commit assignment.sh -m "describe your changes here"
Your coworkers have made some other changes to the script. You'll need to incorporate their updates and resolve any conflicts.
- Merge the Updates: Use the following command to pull in changes from the coworker's branch:
git pull https://github.com/UofT-DSI/shell coworker-changes --no-rebase
- Resolve Merge Conflicts: If there are any conflicts, use
git status
to see which files are affected, resolve the conflicts manually, and then mark them as resolved. - Commit the Merge: Once all conflicts are resolved, commit the merge.
- Re-test Your Script: Make sure that your script still works after merging the updates.
- Optional Clean Test Setup: If you'd like to test your script in a clean environment, follow these steps:
mkdir assignment_test_clean # make an empty directory
cp assignment.sh assignment_test_clean # copy your script into the empty directory
cd assignment_test_clean # change your working directory to the new clean directory
- Run Your Script:
bash assignment.sh
- Verify the Output:
- Check if the expected directories are created.
- Verify that files are moved or copied as expected.
- Ensure that files that should be deleted are no longer present.
- Commit Your Final Changes: Ensure all changes are committed in your
assignment
branch. You can verify this with:git status
- Enable GitHub Actions: Click on the Actions tab in your repository and enable workflows if prompted.
- Create a Pull Request:
- Open a pull request from your
assignment
branch to your repository'smain
branch. - The autograder will run automatically and post your assignment grade as a comment.
- Open a pull request from your
🚨 Please review our Assignment Submission Guide 🚨 for detailed instructions on how to format, branch, and submit your work. Following these guidelines is crucial for your submissions to be evaluated correctly.
- Submission Due Date:
2024-11-24 - 23:59
- The branch name for your repo should be:
assignment
- What to submit for this assignment:
- One or more commits that update the
assignment.sh
script
- One or more commits that update the
- What the pull request link should look like for this assignment:
https://github.com/<your_github_username>/shell/pull/<pr_id>
- Open a private window in your browser. Copy and paste the link to your pull request into the address bar. Make sure you can see your pull request properly. This helps the technical facilitator and learning support staff review your submission easily.
Checklist:
- Create a branch called
assignment
. - Ensure that your repository is public.
- Review the PR description guidelines and adhere to them.
- Verify that your link is accessible in a private browser window.