Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
18f8442
ultimas configurações do projeto base
robsoninocencio Mar 3, 2021
f7aa72e
Criando recurso Category e Genre
robsoninocencio Mar 8, 2021
1456c01
adicionando workspace do insomnia das rotas Categories e Genres.
robsoninocencio Mar 8, 2021
c98db43
ajustando o verbo post
robsoninocencio Mar 8, 2021
8661d1f
Ajuste para que no verbo post o retorno da api retornasse o id com o …
robsoninocencio Mar 9, 2021
4431723
Completei módulo "INICIANDO COM TESTES AUTOMATIZADOS NO LARAVEL"
robsoninocencio Mar 15, 2021
1a6880f
Create .env.testing
robsoninocencio Mar 15, 2021
39490cf
teste de persistencia1 .env.testing
robsoninocencio Mar 15, 2021
3af3dae
importando classses SoftDeletes e Uuid para que teste unitario passe.
robsoninocencio Mar 15, 2021
b4e2bb2
Criação teste unitário Genre
robsoninocencio Mar 15, 2021
2761e2e
Finalizando módulo testes com HTTP
robsoninocencio Mar 21, 2021
bbd218a
Testes com http
robsoninocencio Mar 21, 2021
4a43c99
Corrigindo fase de projeto criando testes http para categorias e generos
robsoninocencio Mar 21, 2021
6755570
Correção Desafio Testes com HTTP
robsoninocencio Mar 22, 2021
99bbbab
Organizando asserções em Category
robsoninocencio Mar 24, 2021
b248e0b
Organizando asserções em Genre
robsoninocencio Mar 24, 2021
f9e5e62
Recuperando model pela Id de forma dinâmica
robsoninocencio Mar 25, 2021
c3b8d94
adicionando cloudbuild.yaml
robsoninocencio Apr 7, 2021
c419664
adicionando passos na esteira ci
robsoninocencio Apr 7, 2021
93c1d71
teste
robsoninocencio Apr 7, 2021
4db384c
teste
robsoninocencio Apr 7, 2021
97f2215
teste
robsoninocencio Apr 7, 2021
304111f
teste
robsoninocencio Apr 7, 2021
b281e6f
Rodando composer
robsoninocencio Apr 7, 2021
983fec4
add docker ps in cloudbuild
robsoninocencio Apr 7, 2021
d097bba
add composer cloudbuild
robsoninocencio Apr 7, 2021
de809b7
add container micro-videos-app
robsoninocencio Apr 7, 2021
3e28091
montando esteira ci cloudbuild.yaml
robsoninocencio Apr 7, 2021
92f3d54
php artisan ide-helper:models --nowrite --quiet
robsoninocencio Apr 7, 2021
df52081
montando esteira ci cloudbuild
robsoninocencio Apr 7, 2021
16594e8
No cloudbuild.yaml trocar o acesso ao docker de gcr.io/cloud-builders…
robsoninocencio Apr 7, 2021
62f747c
Alterando cloudbuild de gcr.io/$PROJECT_ID/docker-compose:1.25.5 para…
robsoninocencio Apr 7, 2021
fc1e246
add extensão devcontainer
robsoninocencio Apr 7, 2021
c57cadc
teste
robsoninocencio Apr 8, 2021
e4bbd9a
teste
robsoninocencio Apr 8, 2021
15c7ff5
MIGRATIONS em caixa alta
robsoninocencio Apr 8, 2021
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
81 changes: 45 additions & 36 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,56 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.128.0/containers/docker-existing-docker-compose
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.163.1/containers/docker-existing-docker-compose
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
{
"name": "Laravel QuickStart",

// Update the 'dockerComposeFile' list if you have more compose files or use different names.
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
"dockerComposeFile": [
"../docker-compose.yaml",
"docker-compose.yml"
],

// The 'service' property is the name of the service for the container that VS Code should
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
"service": "app",

// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/laravel-quickstart",

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"name": "Micro-videos-backend",

// Update the 'dockerComposeFile' list if you have more compose files or use different names.
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
"dockerComposeFile": ["../docker-compose.yaml", "docker-compose.yml"],

// The 'service' property is the name of the service for the container that VS Code should
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
"service": "app",

// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/micro-videos-backend",

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"recca0120.vscode-phpunit",
"hbenl.vscode-test-explorer",
"emallin.phpunit",
"rexshi.phpdoc-comment-vscode-plugin",
"ms-azuretools.vscode-docker",
"felixfbecker.php-debug",
"felixfbecker.php-intellisense",
"bmewburn.vscode-intelephense-client",
"devsense.phptools-vscode",
"an0rak-dev.vscode-gcp-cloudbuild",
"zxh404.vscode-proto3",
"redhat.vscode-yaml",
"calebporzio.better-phpunit",
"mhutchie.git-graph"
]

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line if you want start specific services in your Docker Compose config.
// "runServices": [],
// Uncomment the next line if you want start specific services in your Docker Compose config.
// "runServices": [],

// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
// "shutdownAction": "none",
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
// "shutdownAction": "none",

// Uncomment the next line to run commands after the container is created - for example installing curl.
// "postCreateCommand": "apt-get update && apt-get install -y curl",
// Uncomment the next line to run commands after the container is created - for example installing curl.
// "postCreateCommand": "apt-get update && apt-get install -y curl",

// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}
26 changes: 10 additions & 16 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,31 @@
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

version: '3'
version: "3"
services:
# Update this to the name of the service you want to work with in your docker-compose.yml file
app:
# If you want add a non-root user to your Dockerfile, you can use the "remoteUser"
# property in devcontainer.json to cause VS Code its sub-processes (terminals, tasks,
# debugging) to execute as the user. Uncomment the next line if you want the entire
# container to run as this user instead. Note that, on Linux, you may need to
# ensure the UID and GID of the container user you create matches your local user.
# property in devcontainer.json to cause VS Code its sub-processes (terminals, tasks,
# debugging) to execute as the user. Uncomment the next line if you want the entire
# container to run as this user instead. Note that, on Linux, you may need to
# ensure the UID and GID of the container user you create matches your local user.
# See https://aka.ms/vscode-remote/containers/non-root for details.
#
# user: vscode

# Uncomment if you want to override the service's Dockerfile to one in the .devcontainer
# folder. Note that the path of the Dockerfile and context is relative to the *primary*
# Uncomment if you want to override the service's Dockerfile to one in the .devcontainer
# folder. Note that the path of the Dockerfile and context is relative to the *primary*
# docker-compose.yml file (the first in the devcontainer.json "dockerComposeFile"
# array). The sample below assumes your primary file is in the root of your project.
#
# build:
# context: .
# dockerfile: .devcontainer/Dockerfile

volumes:
# Update this to wherever you want VS Code to mount the folder of your project
- .:/laravel-quickstart:cached
- .:/micro-videos-backend:cached

# Uncomment the next line to use Docker from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker-compose for details.
# - /var/run/docker.sock:/var/run/docker.sock
# - /var/run/docker.sock:/var/run/docker.sock

# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
# cap_add:
Expand All @@ -40,4 +35,3 @@ services:

# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"

45 changes: 45 additions & 0 deletions .docker/app/.env.testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
APP_NAME=Laravel
APP_ENV=testing
APP_KEY=base64:KXriJ44+bmjwlMw6u8kD2cvxoNssPsfu+E0oMb/DcQE=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST={{ .Env._DB_HOST }}
DB_PORT=3306
DB_DATABASE={{ .Env._TEST_DB_DATABASE }}
DB_USERNAME={{ .Env._DB_USERNAME }}
DB_PASSWORD={{ .Env._DB_PASSWORD }}

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"

MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
2 changes: 2 additions & 0 deletions .docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

#On error no such file entrypoint.sh, execute in terminal - dos2unix .docker\entrypoint.sh
# cp .env.example .env
# cp .env.testing.example .env.testing
chown -R www-data:www-data .
composer install
php artisan key:generate
Expand Down
2 changes: 2 additions & 0 deletions .docker/mysql/initdb.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE DATABASE IF NOT EXISTS code_micro_videos;
CREATE DATABASE IF NOT EXISTS code_micro_videos_test;
7 changes: 6 additions & 1 deletion .docker/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
FROM nginx:1.15.0-alpine

ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz

RUN rm /etc/nginx/conf.d/default.conf
COPY ./nginx.conf /etc/nginx/conf.d

COPY nginx.conf.template /etc/nginx/conf.d/default.conf
1 change: 1 addition & 0 deletions .docker/nginx/DockerfileCI
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM nginx:1.15.0-alpine
20 changes: 20 additions & 0 deletions .docker/nginx/nginx.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
server{
listen {{ .Env.NGINX_PORT }};
index index.php index.html;
root /var/www/public;

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}

location / {
try_files $uri $uri/ /index.php?$query_string;
gzip_static on;
}
}
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ APP_URL=http://localhost
LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_HOST=db
DB_PORT=3306
DB_DATABASE=laravel
DB_DATABASE=code_micro_videos
DB_USERNAME=root
DB_PASSWORD=
DB_PASSWORD=root

BROADCAST_DRIVER=log
CACHE_DRIVER=file
Expand Down
45 changes: 45 additions & 0 deletions .env.testing.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
APP_NAME=Laravel
APP_ENV=testing
APP_KEY=base64:KXriJ44+bmjwlMw6u8kD2cvxoNssPsfu+E0oMb/DcQE=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=code_micro_videos_test
DB_USERNAME=root
DB_PASSWORD=root

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"

MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/storage/*.key
/vendor
.env
.env.testing
.env.backup
.phpunit.result.cache
Homestead.json
Expand All @@ -15,3 +16,5 @@ yarn-error.log
.vscode/
.history/
.devcontainer/
_ide_helper_models.php
_ide_helper.php
20 changes: 20 additions & 0 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM php:7.3.6-fpm-alpine3.9

RUN apk add --no-cache openssl bash mysql-client nodejs npm
RUN docker-php-ext-install pdo pdo_mysql

WORKDIR /var/www
RUN rm -rf /var/www/html

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

COPY . /var/www

RUN composer install && \
php artisan config:cache && \
chmod -R 777 storage

RUN ln -s public html

EXPOSE 9000
ENTRYPOINT ["php-fpm"]
Loading