Skip to content

Commit d672835

Browse files
DevOps Lab 2021
0 parents  commit d672835

13 files changed

+1012
-0
lines changed

.travis.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Linguagem Utilizada para Desenvolver a Aplicação
2+
language: python
3+
4+
# Versão que a aplicação suporta.
5+
python:
6+
- "3.7"
7+
8+
# Faz a instalação com Sudo, para ter privilégio de Super Usuário.
9+
sudo: required
10+
11+
# Instalação de Módulos que são necessários para a Aplicação.
12+
install:
13+
- pip install flask
14+
15+
# Defini o script de Teste que deve rodar toda vez que o código for alterado.
16+
script:
17+
- python test.py
18+
19+
# Defini que o processo de Deploy será na Plataforma Heroku. É necessário informar o nome da APP criada no Heroku
20+
deploy:
21+
provider: heroku
22+
app: mudar_para_o_nome_de_sua_app_no_heroku

LICENSE

+674
Large diffs are not rendered by default.

Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: gunicorn app:app

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Trilha DevOps da 4Linux
2+
3+
<!-- Altere a Flag abaixo com sua URL do Travis -->
4+
[![Build Status](https://travis-ci.org/sua_conta/simple-unittest.svg?branch=master)](https://travis-ci.org/sua_conta/simple-unittest)
5+
6+
## Aplicação criada para exemplificar o Ciclo de uma PipeLine DevOps
7+
8+
9+
Para maiores informações acesse o [Site da 4Linux](https://www.4linux.com.br/cursos/devops)

app.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from flask import Flask, render_template
2+
3+
app = Flask(__name__)
4+
5+
@app.route("/")
6+
def index():
7+
return render_template('index.html')
8+
9+
10+
if __name__ == '__main__':
11+
app.run(debug=True)

application.wsgi

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/python3.6
2+
import sys
3+
sys.path.insert(0,'/home/malbano/simple-unittest')
4+
from app import app as application

requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Flask==0.12.2
2+
gunicorn

runtime.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python-3.7.10

static/css/main.css

+90
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/css/main.sass

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
@import url('https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600,700')
2+
3+
$alert: #78d25a
4+
$devops: #00aab0
5+
$devops-color: #fff
6+
$ops: #804297
7+
$ops-color: #fff
8+
$dev: #f0860c
9+
$dev-color: #fff
10+
$ex: #808080
11+
$ex-color: #fff
12+
13+
$main-font: Montserrat
14+
15+
16+
html
17+
box-sizing: border-box
18+
*
19+
box-sizing: inherit
20+
font-family: $main-font
21+
22+
body
23+
margin: 0
24+
25+
img
26+
outline: none
27+
28+
a
29+
color: inherit
30+
31+
.container
32+
max-width: 1024px
33+
margin: auto
34+
35+
.alert
36+
position: fixed
37+
top: 0
38+
left: 0
39+
width: 100%
40+
padding: 8px 16px
41+
border-radius: 0 0 4px 4px
42+
background-color: $alert
43+
text-align: center
44+
font-weight: 700
45+
color: #fff
46+
47+
.logo
48+
text-align: center
49+
img
50+
margin-top: 6%
51+
max-width: 600px
52+
53+
.keep-studying
54+
text-align: center
55+
font-weight: 300
56+
font-size: 30px
57+
58+
.path
59+
h1
60+
font-weight: 600
61+
font-size: 28px
62+
margin-bottom: 8px
63+
64+
.devops-path
65+
h1
66+
border-bottom: 4px solid $devops
67+
color: $devops
68+
69+
.ex-path
70+
h1
71+
border-bottom: 4px solid $ex
72+
color: $ex
73+
74+
.course
75+
vertical-align: top
76+
display: inline-block
77+
width: 49%
78+
padding: 16px
79+
margin-bottom: 12px
80+
border-radius: 2px
81+
background-color: $ex
82+
font-size: 14px
83+
color: $ex-color
84+
transition: all 0.3s
85+
&:nth-child(odd)
86+
margin-left: 1%
87+
&:nth-child(even)
88+
margin-right: 1%
89+
&:hover
90+
opacity: 0.8
91+
92+
h2
93+
margin: 0
94+
font-size: 16px
95+
96+
.devops-course
97+
background-color: $devops
98+
color: $devops-color
99+
100+
.ops-course
101+
background-color: $ops
102+
color: $ops-color
103+
104+
.dev-course
105+
background-color: $dev
106+
color: $dev-color
107+

static/imgs/4linux.jpg

20.1 KB
Loading

templates/index.html

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<!DOCTYPE html>
2+
<html lang="pt-BR">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<title>Document</title>
9+
<link rel="stylesheet" href="/static/css/main.css">
10+
</head>
11+
12+
<body>
13+
<div class="alert">Escreva uma Mensagem para o Cabeçalho da Página.</div>
14+
15+
<div class="container">
16+
<div class="logo">
17+
<img src="/static/imgs/4linux.jpg" alt="4Linux">
18+
</div>
19+
</div>
20+
21+
<div class="container">
22+
<div class="devops-paths">
23+
24+
<p class="keep-studying">Não fique parado, continue estudando sobre DevOps e Containers!</p>
25+
26+
<div class="devops-path path">
27+
<h1>Trilha DevOps</h1>
28+
<a href="https://4linux.com.br/cursos/treinamento/ci-cd-integracao-e-entrega-continua-com-git-jenkins-nexus-e-sonar" class="devops-course course">
29+
<h2>524 - CI/CD: INTEGRAÇÃO E ENTREGA CONTINUA COM GIT, JENKINS, NEXUS E SONAR</h2>
30+
</a><!--
31+
--><a href="https://4linux.com.br/cursos/treinamento/infraestrutura-agil-com-praticas-devops" class="devops-course course">
32+
<h2>525 - INFRAESTRUTURA ÁGIL COM PRÁTICAS DEVOPS</h2>
33+
</a><!--
34+
--><a href="https://www.4linux.com.br/curso/continuous-monitoring" class="ops-course course">
35+
<h2>527 - DEVSECOPS: SEGURANÇA EM INFRAESTRUTURA E DESENVOLVIMENTO ÁGIL</h2>
36+
</a><!--
37+
--><a href="https://4linux.com.br/cursos/treinamento/praticas-de-continuous-monitoring-para-uma-infraestrutura-agil/" class="ops-course course">
38+
<h2>528 - PRÁTICAS DE CONTINUOUS MONITORING PARA UMA INFRAESTRUTURA ÁGIL</h2>
39+
</a>
40+
</div>
41+
42+
<div class="ex-path path">
43+
<h1>Trilha Containers</h1>
44+
<a href="https://4linux.com.br/cursos/treinamento/docker-administracao-de-containers-dca" class="ex-course course">
45+
<h2>540 - DOCKER: ADMINISTRAÇÃO DE CONTAINERS – DCA</h2>
46+
</a><!--
47+
--><a href="https://4linux.com.br/cursos/treinamento/kubernetes-orquestracao-de-ambientes-escalaveis" class="ex-course course">
48+
<h2>541 - KUBERNETES: ORQUESTRAÇÃO DE AMBIENTES ESCALÁVEIS</h2>
49+
</a><!--
50+
--><a href="https://4linux.com.br/cursos/treinamento/openshift-administracao-paas-em-containers" class="ex-course course">
51+
<h2>542 - OPENSHIFT: ADMINISTRAÇÃO PAAS EM CONTAINERS/</h2>
52+
</a><!--
53+
--><a href="https://4linux.com.br/cursos/treinamento/gerenciamento-de-cluster-kubernetes-com-rancher" class="ex-course course">
54+
<h2>543 - GERENCIAMENTO DE CLUSTER KUBERNETES COM RANCHER</h2>
55+
</a>
56+
</div>
57+
58+
</div>
59+
</div>
60+
61+
</body>
62+
63+
</html>

test.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from app import app
2+
import unittest
3+
4+
class Test(unittest.TestCase):
5+
6+
def setUp(self):
7+
# cria uma instancia do unittest, precisa do nome "setUp"
8+
self.app = app.test_client()
9+
10+
def test_requisicao(self):
11+
# envia uma requisicao GET para a URL
12+
result = self.app.get('/')
13+
14+
# compara o status da requisicao (precisa ser igual a 200)
15+
self.assertEqual(result.status_code, 200)
16+
17+
def test_conteudo(self):
18+
# envia uma requisicao GET para a URL
19+
result = self.app.get('/')
20+
21+
# verifica o retorno do conteudo da pagina
22+
self.assertRegex(result.data.decode(), "Escreva uma Mensagem para o Cabecalho da Pagina.")
23+
24+
25+
if __name__ == "__main__":
26+
print ('INICIANDO OS TESTES')
27+
print('----------------------------------------------------------------------')
28+
unittest.main(verbosity=2)

0 commit comments

Comments
 (0)