2. Project management¶
Assignment
- Work through a git tutorial
- Build a personal site in the class archive describing you and your final project
This week I worked on how to work with Control Version Systems, I worked with Mercurial and GIT, also I updated the information in the Gitlab.
Working Control Version Git¶
In this item I work with Control Version’s GIT, it is the official CVS tool to create Web Site on Gitlab and the created documentation of the assignments every week. Also I work with MKDOCS tool to check my web site OFFLINE the way I accelerate the website design.
Install Git¶
- Download the install’s file of official page https://git-scm.com/download/win to windows choose the 64 bit Git for Windows Setup file.
- Execute the file as Administrator and windows explorer:
- I start the installation with tipical defautls windows, when I choose the NEXT button:
- When require the installation path, I choose default path, and I choose NEXT button:
- In a window the installation gives tool’s options to work with software, I choose default configuration but we choose other configuration according requirements, I choose NEXT button:
- And finally after a lot of windows of configuration the installation, I choose INSTALL button:
- It take some seconds o minutes according the computer features, I only wait to finish:
- Finally; the installation is ready
Clone Gitlab’s Project¶
- First I created a Folder where I will work my FabAcademy’s website, my path is:
C:\Users\ULISES\Documents\FabAcademy
- Run the Git Bash into the path:
- I used the command to create the global config to login:
git config --global user.name "User's Name" git config --global user.email "User's Email"
I can check the configuration with the following command:
git config --global user.name git config --global user.email
- I check the SSH Keys of my computer, it does with the follownig command:
cat ~/.ssh/id_rsa.pub
- If the SSH Key is not created, I create it, it does with the follownig command:
ssh-keygen -t rsa -C "ugordillo@tecsup.edu.pe"
It requires the file to save the key, it is empty and press ENTER
- After, it requires a password to validate the user, I put a password of 5 letters, for example: “12345” or “abcde”; it requires 2 times:
- It was created, now my computer has a SSH Key to work:
- When I repeat the command to request the SSH Key, and it returns, I copied all, from “ssh-rsa AAA.. until .edu.pe”:
- Now, I login Gitlab and add the SSH Key to work; first Sign In Gitlab in the following url https://gitlab.fabcloud.org/academany/fabacademy/2020
- I registered and signed in the fisrt time, I will work with the Tecsup’s email:
- After Login, I choose the Projects button to get in the student’s website of Fabacademy:
- I choose the project create for FabAcademy’s Staff:
- I see my panel to control my website, where I see the last commit, the clone options, the commit’s status, the website’s size:
- Now, To add the SSH Keys in Giltab I choose button Settings from my user’s option:
- After I choose the button of SSH Keys:
- There is a space to paste the SSH Key created and copied in before steps:
-Now I have a permission to work GIT with GITLAB and publish in my website:
- I copy the url to clone the project in my computer:
- Now I clone my website in my computer, it does with the follownig command:
git clone "url_your_website_in_gitlad_by_SSH"
Then I have the file ready to work and documentate all the weeks.
Working Web Site OFFLINE¶
To work offline, I instal mkdocs software in Python, then in this item, I preparate all dependencies, then let’s start:
Install Python 3.7¶
- Download the install’s file of official page https://www.python.org/downloads/windows/ to windows choose the 64 bit executable installer file.
- I execute the installer file as Administrator:
- I start the installation, the first windows choose or check the Add Python 3.7 to PATH on windows and I click the Install Now option:
- I continue the installation windows until I finish the progress installation:
- Finally, I close the last windows to installation:
- To work I search the IDLE in windows’s program, I see the following windows:
- Now, I have the Python’s software ready to work:
Install mkdocs¶
- To install the MKDOCS tools, you have to do it over Python, so I used the PIP Python tool to install the files, I run the CMD:
- I write the command to install the mkdocs’s files, it does with the following command:
pip install mkdocs
- So the installation ocurred installing the dependecy files of MKDOCS tool:
Install material’s library¶
- Among the tools for designing the website, the Fab Academy Staff prepared the files to work with the MATERIAL library; this tool is for making a website with a good appearance, I used the CMD tool and write the following command:
pip install mkdocs-material
- So the installation ocurred installing the dependecy files of MKDOCS-MATERIAL tool:
Editing the Website OFFLINE¶
- Now, I am ready to work offline in my website design, so I follow it steps to check my page until to update it on GITLAB; I run the CMD tool over the website design’s path; to create the website server I write the following command:
mkdocs serve
- So it run a server over my computer on the following address:
127.0.0.1:8000
- Afterwards, I can change the website’s content with any text editor, in my case I used SUBLIME TEXT:
I use some commun instruction to edit the website’s page, the instructions are some Markdown’s Instructions and some Html’s instructions, this is a table with what is used:
Instruction | Descriptions |
---|---|
# | It work similar the headers h1 in HTML |
## | It work similar the headers h2 in HTML |
## | It work similar the headers h3 in HTML |
*cursive* | It change the text to cursive |
**bold** | It change the text to bold |
<pre> native code</pre> | It put the text in native code |
<iframe width=”677” height=”381” src=”https://www.youtube.com/embed/rsj_k7lEXxs” frameborder=”0” allow=”accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture” allowfullscreen></iframe> | It use to colocate embedded video |
![](../images/week02/mercurial/4.png){width=600px align=center} | It use to add images |
<p align=”center”> <img src=”/images/week17/40_App_Inventor.png” width=50% ></p> | It use to add images |
[https://git-scm.com/download/win](https://git-scm.com/download/win) | It use to add website’s reference |
- So I can check the website appearance, I write the server address on web explorer and I can see the website:
127.0.0.1:8000
Working Web Site ONLINE to Gitlab¶
To update the changed in my computer to my Website’s Gitlab, I must perform the following steps:
- First, I check the status of commit, it does with the follownig command:
git status
I see the files that was changed
- Afterwards, I add the changed files to update; it does with the follownig command:
git add .
- Afterwards , I commit the added files to update; it does with the follownig command:
git commit -m "Commit's Message"
- Afterwards, I update the file in Gitlab with the password that was entered in previous steps:
git push
- I can see how it is updated in gitlab, first it gets in paused and evaluates the code, also the message sent appear in actual commit:
- Afterwards some minutes Gitlab finishs the evaluation and the commit appears passed
- To see the commit’s historial as Jobs, I choose the CI/CD button in the user’s option:
- I can see all the Jobs did with the Gitlab’s website
Testing Control Version Mercurial¶
In this item, I testing the Mercurial’s work, but it does not work with gitlab, the gitlab is used to Web site’s FabAcademy and then only Mercurial is used to version control but not to create a Web Site of Student’s Fabacademy; then let’s start:
Install Mercurial¶
- Download the install’s file of official page https://www.mercurial-scm.org/downloads to windows choose the MSI installer file.
- I executed the install’s file with administrator’s permission:
- On Windows appear a permission by the antivirus Windows Defender, then I excecute the permission.
- I start the installation’s steps with the normal progress, clic on NEXT:
- We can see the installation progress during some seconds and until it finish:
-
After installation finished, I add the windows’s path to Mercurial’s executable file.
-
I opened the Windows Systems’s properties:
- I entered to Systems Variables -> Choose Path -> New Path; and add the path “C:\Program Files\Mercurial”; and accept all windows.
Working Control Version with Mercurial¶
- Then, we are ready to work with Mercurial on any Windows’s folder; I created 2 testing’s files: “index.html” and “fab_academy.jpg”
- The Mercurial Software works over Command’s Console, then I run the CMD on the created file’s path:
- To test the Mercurial’s correct work, I type the command:
hg
Then it must return the following message:
- Then we are ready to start the version’s control; I init the project with the command in the folder:
hg init
- After, I add the file to Control Version System with the command
hg add
Then the files “index.html” and “fab_academy.jpg” are add to Control Version:
- I can test the control version’s status with the command:
hg st
It must return the message with:
A + FileName
In all cases, see the example:
- I can do a commit to save the files in Version’s Control, type the command:
hg commit -m “Message to Commit”
- Now, I can change the content in the files; In my case, I change the content at following:
- When I request to status of Version Control, it return the message:
M + FileName
- Then, I did the update of Version, with the following steps:
hg add
hg commit -m “Message Second Commit”
Thes files are saved on the actual commit
Problem in Gitlab Compilation¶
When I work in Week 11 to Course’s FabAcademy, there was a problem in updating gitlab, that not permit pass the code and update the content’s website.
I review the details of the job’s informacion and sends me a error Building wheel for regex:
With the help of Tecsup instructor, we consultate Pipeline broken issue on gitlab:
We write to consultate Why the pipeline failed?:
In some hours FabAcademy’s Staff answer me; they write me Why the pipeline fails and How I solutionate the problem.
The problem was the version of material library and the version of python; I had edit:
In requierements.txt file change mkdocs-material with mkdocs-material<5 And edit .gitlab-ci.yml file change image: python:alpine with image:python:3.6
Afterwards, It work normally and it solutionated