Appuyez sur [s] pour ouvrir les notes présentateur dans une nouvelle fenêtre.
Utilisez la touche [ESPACE]
pour passer au slide suivant.
Bienvenue !
Tu vas prendre en gros la semaine pour installer ton poste.
Moué…
Comme ils ont dû te dire, tu vas en avoir pour à peu près deux semaines à installer ton poste.
WAT?
(pour le moment)
Installation manuelle
Peu (pas ?) à jour sur un wiki deux wikis
se contredisant !
Collègue a pris son PC (fixe) et est venue en pair avec moi
… pendant une semaine.
Vagrant.configure("2") do |config|
config.vm.define "tea-demo" do |test|
test.vm.box = "tea-wheezy-amd64"
test.vm.hostname = "tea-demo"
test.vm.network :private_network, ip: "192.168.3.10"
db.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", 1024]
end
test.omnibus.chef_version = :latest
test.vm.provision "chef_solo" do |chef|
chef.cookbooks_path = "#{my_ws}/cookbooks"
chef.add_recipe "tea-demo"
chef.add_recipe "tea-plateforme"
end
end
end
include_recipe "percona::server"
template "/etc/mysql/conf.d/tea.cnf" do
source "tea.cnf.erb"
owner "root"
group "root"
mode "0644"
end
service 'mysql' do
action [:enable, :restart]
end
root_password = node["percona"]["server"]["root_password"];
sql_commands = "GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION; SET PASSWORD FOR 'root'@'%' = PASSWORD('#{root_password}');"
execute "mysql-allow-access-from-remote" do
command %(/usr/bin/mysql -p'#{root_password}' -e "#{sql_commands}")
end
Des scripts !
composer installcomposer install.diststowArborescence extraite de git
$ tree
.
|-- app
| `-- config
|-- config
`-- config-dist
`-- local
|-- app
| `-- config
| `-- specifique-appli.txt
`-- config
`-- test.yml
$ stow --dir=config-dist --target=. local
Arborescence avec les symlinks
$ tree
.
|-- app
| `-- config
| `-- specifique-appli.txt
-> ../../config-dist/local/app/config/specifique-appli.txt
|-- config
| `-- test.yml -> ../config-dist/local/config/test.yml
`-- config-dist
`-- local
|-- app
| `-- config
| `-- specifique-appli.txt
`-- config
`-- test.yml
Communication entre services
/etc/hostsServeur DNS
$ git clone mon-projet.git
$ vagrant up ma-vm
$ composer install
$ stow --dir=config-dist local
$ bin/atoum && bin/behat
\o/
Dockerfiledocker builddocker run
FROM docker-registry.staging.tea-ebook.com/base-wheezy:latest
MAINTAINER TEA, technique@tea-ebook.com
ADD ./chef/ /chef
RUN cd /chef && LANG="C.UTF-8" ↩
/opt/chef/embedded/bin/berks install \
&& LANG="C.UTF-8" /opt/chef/embedded/bin/berks ↩
vendor /chef/all-cookbooks \
&& (chef-solo -c /chef/solo.rb ↩
-j /chef/solo.json || true)
{% verbatim %}CONTAINER_NAME='tea-backend'
IMAGE_NAME="$CONTAINER_NAME:70"
PHYSICAL_IP=$(/sbin/ifconfig "$BRIDGENAME" |filter_ip)
docker run \
-v "$WORKSPACE/backend/":/var/www/BackendTEA/current:rw \
-w /var/www/BackendTEA/current \
-d \
--dns "$PHYSICAL_IP" \
--name "$CONTAINER_NAME" \
"${IMAGE}"
CONTAINER_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $CONTAINER_NAME)
echo "address=/backend.lxc/${CONTAINER_IP}" > "/etc/dnsmasq.d/$CONTAINER_NAME"
sudo /etc/init.d/dnsmasq restart{% endverbatim %}
FROM docker-registry.staging.tea-ebook.com/base-jessie:latest
MAINTAINER TEA, technique@tea-ebook.com
# Activation dotdeb
RUN echo "deb http://packages.dotdeb.org jessie all" >> /etc/apt/sources.list \
&& wget https://www.dotdeb.org/dotdeb.gpg -O /tmp/dotdeb.gpg \
&& apt-key add /tmp/dotdeb.gpg \
&& rm /tmp/dotdeb.gpg \
&& apt-get update
# Installation PHP 7 + extensions
RUN apt-get update \
&& apt-get install -y --no-install-recommends php7.0-fpm php7.0-cli \
php7.0-dev php-curl php-intl php-json php-mysql php-sqlite3 php-opcache \
&& apt-get clean
masterNotre env. de dév. n’est (presque)
plus un bizutage :-)
Première mise en prod
2 semaines
3 jours pour installer mon poste ; je ne me suis pas senti productif.
git clone + stow + composer install + bundle install
blog.pascal-martin.fr
contact@pascal-martin.fr
@pascal_martin
TEA, The Ebook Alternative