After creating the source code for frontend and backend of my bio, it was time for setting up the source control for efficient code tracking and maintainence.
Prerequisites for PC
Source Control
Source code management systems allow you to track your code change, see a revision history for your code, and revert to previous versions of a project when needed.
You can either use AWS CodeCommit or Git for this purpose. I chose Git for this website.
Github
For continuous integration and deployment, or CI/CD
of my sources I created two repositories for my frontend and backend.
CI/CD Frontend git repository : read more
Git: https://github.com/jicoing/git-komlalebu
- I created a git repository by the name
git-komlalebu
in Github and cloned it to my local with the URL.
CMD
>git clone https://github.com/jicoing/git-komlalebu.git
The basic tree structure should look like this.
Withindex.html
,styles.css
,error.html
and some image files for my website under the root.
Folders:
workflows
- Needed for Github actions*. Read more.
Actions
- Needed for Github actions*. Read more.
>C:\Users\USER_NAME\git-komlalebu>tree
Tree:
git-komlalebu
┣ 📂.github
┃ ┣ 📂actions
┃ ┃ ┗ 📂sam
┃ ┃ ┃ ┗ 📂package
┃ ┃ ┃ ┃ ┣ 📜action.yml
┃ ┃ ┃ ┃ ┣ 📜Dockerfile
┃ ┃ ┃ ┃ ┗ 📜entrypoint.sh
┃ ┗ 📂workflows
┃ ┃ ┗ 📜main.yml
┣ 📜error.html
┣ 📜git.png
┣ 📜hilltop.PNG
┣ 📜html.png
┣ 📜index.html
┣ 📜Komladefault.png
┣ 📜Komlaprocesslogo.gif
┣ 📜README.md
┣ 📜squirrel.png
┣ 📜styles.css
┗ 📜whale.png
- Then I pushed contents of
C:\Users\USER_NAME\git-komlalebu
from local to my git repository.
CMD
C:\Users\USER_NAME\git-komlalebu>git add .
C:\Users\USER_NAME\git-komlalebu>git commit -m master
C:\Users\USER_NAME\git-komlalebu>git push origin master
git-add - Add file contents to the index.
git commit -m master - Record changes to the repository.
git push origin master - pushes the code to master branch.
CI/CD Backend git repository : read more
Git: https://github.com/jicoing/git-komlalebu-sam
- I created a git repository by the name
git-komlalebu-sam
in Github and cloned it to my local with the URL.
CMD
>git clone https://github.com/jicoing/git-komlalebu-sam.git
The basic tree structure should look like this with
template.yml
file andkomlalebu_function
folder under the root of the directory.
template.yml
- has my SAM template.
komlalebu_function
folder - has app.py python code that goes into my lambda function.
Folders:
Workflows
- Needed for Github actions*. Read more
Actions
- Needed for Github actions*. Read more
C:\Users\USER_NAME\git-komlalebu-sam>tree
Tree:
git-komlalebu-sam
┣ 📂.github
┃ ┣ 📂actions
┃ ┃ ┗ 📂sam
┃ ┃ ┃ ┗ 📂package
┃ ┃ ┃ ┃ ┣ 📜.gitignore
┃ ┃ ┃ ┃ ┣ 📜action.yml
┃ ┃ ┃ ┃ ┣ 📜Dockerfile
┃ ┃ ┃ ┃ ┣ 📜entrypoint.sh
┃ ┃ ┃ ┃ ┣ 📜LICENSE
┃ ┃ ┃ ┃ ┗ 📜README.md
┃ ┗ 📂workflows
┃ ┃ ┗ 📜ci.yml
┣ 📂komla_function
┃ ┣ 📜app.py
┃ ┗ 📜requirements.txt
┣ 📜README.md
┗ 📜template.yaml
- Then I pushed contents of
C:\Users\USER_NAME\git-komlalebu-sam
from local to my git repository.
CMD
C:\Users\USER_NAME\git-komlalebu-sam>git add .
C:\Users\USER_NAME\git-komlalebu-sam>git commit -m master
C:\Users\USER_NAME\git-komlalebu-sam>git push origin master
Top comments (0)