Skip to content
Open

Main #18

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
180 changes: 161 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,161 @@
<h1>Material Design One Page HTML Template</h1>
<p>MD One page template is fully responsive and free to use. This HTML template is based on <a href="http://materializecss.com/">Materialize</a>, a CSS Framework based on Material Design.</p>
<a href="http://joashpereira.com/templates/material_one_pager/">View Demo</a>
<br/>
<h3>Screenshots</h3>
<img src="https://m1.behance.net/rendition/modules/155787441/disp/f7713eb665752f2da380ec8f7a3cdcae.png" height="300px"/> <img src="https://m1.behance.net/rendition/modules/155787447/disp/e546efd70f5b46e45829e0da79375243.png" height="300px"/>
<br/>
<a href="https://www.behance.net/gallery/23484793/Material-Design-One-Page-Template">View More Screens</a>
<h3>Platforms used</h3>
HTML, CSS, JS

<h3>Resources</h3>
<ul>
<li><a href="http://materializecss.com/">Materialize</a></li>
<li><a href="http://www.materialpalette.com/">Material Design Colors</a></li>
</ul>

<h2>License</h2>
Material Design One Page HTML Template is licensed under the <a href="http://sam.zoy.org/wtfpl/">WTFPL license</a>.
# Task report

## **Spin up a Virtual Machine**
<br>
<p align="center">
<img width="800" alt="virtualbox" src="https://user-images.githubusercontent.com/76659421/136595470-0ba5e8bb-decb-4b2b-9e99-702e0b8df2fe.png">
</p>
</br>

---

## **Install Nginx web server and git**
To install Nginx, run the following commands:

```bash
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install nginx
#Check the version
nginx -v
#Check nginx status (running or not)
systemctl status nginx
```

To install git, run the following commands:

```bash
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git
#Add to config global variables
git config --global user.name "Nikolay Doroshchenko"
git config --global user.email "mikalaid@playtika.com"
```
Cloning a remote repository:

```bash
git clone https://github.com/Mynaniag/material-design-template.git
```

Generate ssh key:

```bash
ssh-keygen
cat /home/${USER}/.ssh/id_rsa.pub #<----- The output should be copied and pasted into your git settings.
```
---
## **Fork GitHub repository**

1. On GitHub, navigate to the [joashp/material-design-template](https://github.com/joashp/material-design-template).
2. In the top-right corner of the page, click Fork.

<p align="center">
<img width="190" alt="Fork" src="https://user-images.githubusercontent.com/76659421/136669036-be5f845c-5107-4077-881d-159bf288e762.png">
</p>

---

## __Setup a cron job for a regular (every 1 minute) checkout from main branch__

### First step - install cronjob.

To install cron, run the following commands:
```bash
sudo apt update
sudo apt install cron
```
To enable cron, enter this command:
```bash
sudo systemctl enable cron
```
Output:
```
Synchronizing state of cron.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable cron
```
### Second step - write script.

Open crontab file:
```bash
crontab -e
```
After using ``crontab -e`` command, select some text editor and write this line at the end.
```bash
* * * * * cd /home/${USER}/lab/material-design-template && git pull origin master 2>&1 | /usr/bin/logger -t GITLOG1MIN
```
To display logs with information about cronjob operation, enter the following command:
```
grep GITLOG /var/log/syslog
```
Output:
```
Oct 9 19:14:01 mikalaid CRON[28298]: (mikalaid) CMD (cd /home/mikalaid/lab/material-design-template && git pull origin master 2>&1 | /usr/bin/logger -t GITLOG1MIN)
Oct 9 19:14:01 mikalaid GITLOG1MIN: From https://github.com/Mynaniag/material-design-template
Oct 9 19:14:01 mikalaid GITLOG1MIN: * branch master -> FETCH_HEAD
Oct 9 19:14:01 mikalaid GITLOG1MIN: Already up to date.
```

## __-Nginx configuration-__

In order for the site to be accessible in a browser, you must:
1. Configure the ports in the VM:

<img width="638" alt="port" src="https://user-images.githubusercontent.com/76659421/136686663-27bcd038-1a7a-46cd-97f9-1c87c9a072a3.png">

2. Change the line in the ``default`` located in ``etc/nginx/sites-enabled/``:
```bash
root /home/mikalaid/lab/material-design-template/www; #default string <-- root /var/www/html;
```

---

## __Update index.html from your machine, push changes to Git and confirm updated content on web page__

Open index.html file in /www directory and change any line.
```bash
vi index.html
#some changes
```
Push changes to Git:
```
git add .
git commit -m "Change index.html"
git push origin main
```
After that, refresh the page and see the changes.

<img width="1054" alt="Site new" src="https://user-images.githubusercontent.com/76659421/136685867-cb176ca5-f320-47ce-8695-cd1d68daf2aa.png">


---

## __Configure Github hook instead of cron. If VM is not accessible from the Internet, use local git hooks for validation of incoming commits (reject commits if there is a “shit” string in the files)__

---

## __Configure Nginx to Proxy Websockets and cache static content within 1 hour__

---

## __Merge feature branch with main, rebase git merge commit, squash all commits__




















6 changes: 3 additions & 3 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
<h1 class="text_h center header cd-headline letters type">
<span>I Love</span>
<span class="cd-words-wrapper waiting">
<b class="is-visible">creating</b>
<b>designing</b>
<b>developing</b>
<b class="is-visible">WORK</b>
<b>TO</b>
<b>PLAYTIKA</b>
</span>
</h1>
</div>
Expand Down