php conference 2016

36
Ambiente de desenvolvimento com Vagrant, Git, e Deploy. Edison

Upload: edison-costa

Post on 18-Jan-2017

63 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: PHP Conference 2016

Ambiente de desenvolvimento com Vagrant, Git, e Deploy.

Edison Costa

Page 2: PHP Conference 2016

Edison Pereira da Costa

- CTO da AgiusCloud.- Professor e Programador com 30 anos de experiência.- Iniciou sua carreira com a Linguagem COBOL e hoje dedica a maior parte de seu tempo em otimizar servidores Linux, mesmo programando ativamente em PHP.- EasyExpert pela EasyEngine

Email: [email protected]

Github: edisoncosta

PHP CONFERENCE BRASIL - 2016

github.com/edisoncosta/phpconf2016

Page 3: PHP Conference 2016

Cenários

PHP CONFERENCE BRASIL - 2016

Page 4: PHP Conference 2016

SolitárioPHP CONFERENCE BRASIL - 2016

Page 5: PHP Conference 2016

Equipe RemotaPHP CONFERENCE BRASIL - 2016

Page 6: PHP Conference 2016

Equipe LocalPHP CONFERENCE BRASIL - 2016

Page 7: PHP Conference 2016

PREPARANDO O AMBIENTE

PHP CONFERENCE BRASIL - 2016

Page 8: PHP Conference 2016

Oracle VirtualBoxInstalação:

Versão > 4.1.x and < 5.1.x

PHP CONFERENCE BRASIL - 2016

Page 9: PHP Conference 2016

Vagrant (v1.9.1)

Instalação:

(32 and 64-bit)• Windows • OSX• Debian/Ubuntu• CentOS

PHP CONFERENCE BRASIL - 2016

Page 10: PHP Conference 2016

git bash (v2.11.0)

Instalação:

(32 and 64-bit)• Windows

PHP CONFERENCE BRASIL - 2016

Page 11: PHP Conference 2016

SourceTree (v1.9.9.20)

Instalação:

(32 and 64-bit)• Windows • OS X

PHP CONFERENCE BRASIL - 2016

Page 12: PHP Conference 2016

Exemplos de EstruturaMáquinas Virtuais:E:/vagrant/debian8E:/vagrant/homeC:/server/ubuntu14C:/server/agencia

Projetos:E:/projetos/projeto1E:/projetos/projeto2C:/jobs/clienteAC:/jobs/clienteB

PHP CONFERENCE BRASIL - 2016

Page 13: PHP Conference 2016

INICIANDO OS TRABALHOS

PHP CONFERENCE BRASIL - 2016

Page 14: PHP Conference 2016

Acessar o GitBash (terminal) como Administrador:

Criar as pastas da Máquina Virtual e de trabalho.

Pasta da Máquina Virtual$ mkdir server$ cd server$ mkdir debian8

Pasta de Trabalho (App)$ mkdir Jobs$ cd agiuscloud$ mkdir agiuscloud

PHP CONFERENCE BRASIL - 2016

Page 15: PHP Conference 2016

BoxMáquina Virtual base

Add: Vagrant add box ADDRESS\server\debian8>vagrant add box debian/jessie64

List: Vagrant box list\server\debian8>vagrant box list

Remove: Vagrant box remove NAME\server\debian8>vagrant box remove debian/jessie64

PHP CONFERENCE BRASIL - 2016

Page 16: PHP Conference 2016

https://atlas.hashicorp.com/boxes/search

PHP CONFERENCE BRASIL - 2016

Page 17: PHP Conference 2016

Inicializar o diretório atual para ser um ambiente Vagrant e criar o arquivo Vagrantfile.

\server\debian8>vagrant initEditar o arquivo Vagrantfile.

PHP CONFERENCE BRASIL - 2016

Page 18: PHP Conference 2016

EasyEngine

PHP CONFERENCE BRASIL - 2016

Page 19: PHP Conference 2016

Arquivo installserver.sh

PHP CONFERENCE BRASIL - 2016

Page 20: PHP Conference 2016

Halt: Desligar sua VM\server\debian8>vagrant halt

Reload: Reiniciar sua VM\server\debian8>vagrant reload

Suspend: Suspende sua VM\server\debian8>vagrant suspend

destroy: Remove sua VM\server\debian8>vagrant destroy

Up: Iniciar sua VM\server\debian8>vagrant up

Gerenciar a Máquina Virtual

PHP CONFERENCE BRASIL - 2016

Page 21: PHP Conference 2016

Acessar o terminal de sua Máquina Virtual

\server\debian8>vagrant ssh

Acesso rede local

PHP CONFERENCE BRASIL - 2016

Page 22: PHP Conference 2016

Acesso remoto1

/server/debian8>vagrant share --http 8003 --https 4303

/server/debian8/>vagrant login2

3

PHP CONFERENCE BRASIL - 2016

https://atlas.hashicorp.com/account/new

Page 23: PHP Conference 2016

Instalando a aplicaçãoee site create dev.agiuscloud.com --mysql (--hhvm ou –php7)

Editar a configuraçãoee site edit dev.agiuscloud.com

Excluir a aplicaçãoee site delete dev.agiuscloud.com

PHP CONFERENCE BRASIL - 2016

Page 24: PHP Conference 2016

Git / Git Flow

PHP CONFERENCE BRASIL - 2016

Page 25: PHP Conference 2016

PHP CONFERENCE BRASIL - 2016

Page 26: PHP Conference 2016

Git Repositório

PHP CONFERENCE BRASIL - 2016

Page 27: PHP Conference 2016

PHP CONFERENCE BRASIL - 2016

Page 28: PHP Conference 2016

Deploy

PHP CONFERENCE BRASIL - 2016

Page 29: PHP Conference 2016

1 – Criar o VPS em sua hosting de preferência.2 – Acessar sua VPS com o PuTTY.3 – Instalar os Servidores/Serviços com EasyEngine$ sudo wget -qO ac git.io/v1aNA && sudo bash ac4 – Instalar a aplicação.$ ee site create agiuscloud.com --mysql (--hhvm ou –php7) 5 – Fazer o primeiro deploy.

PHP CONFERENCE BRASIL - 2016

Page 30: PHP Conference 2016

PHP CONFERENCE BRASIL - 2016

Page 31: PHP Conference 2016

PHP CONFERENCE BRASIL - 2016

Page 32: PHP Conference 2016

PHP CONFERENCE BRASIL - 2016

Page 33: PHP Conference 2016

PHP CONFERENCE BRASIL - 2016

Page 34: PHP Conference 2016

PHP CONFERENCE BRASIL - 2016

Page 35: PHP Conference 2016

PHP CONFERENCE BRASIL - 2016

Page 36: PHP Conference 2016

Muito Obrigado.

Dúvidas?

PHP CONFERENCE BRASIL - 2016