Chapters
30 Chapters
|
2:45:48
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!Compatible PHP versions: >=5.5.9
Subscribe to download the code!Compatible PHP versions: >=5.5.9
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
17.
Tagging Tasks
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
Subscribe to jump to this part in the video!
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
This tutorial is built using an older version of Symfony, but the core concepts of Ansible are still valid. New versions of Ansible may contain some features that we don't use here.
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": ">=5.5.9",
"symfony/symfony": "3.1.*", // v3.1.4
"doctrine/orm": "^2.5", // v2.7.2
"doctrine/doctrine-bundle": "^1.6", // 1.6.4
"doctrine/doctrine-cache-bundle": "^1.2", // 1.3.0
"symfony/swiftmailer-bundle": "^2.3", // v2.3.11
"symfony/monolog-bundle": "^2.8", // 2.11.1
"symfony/polyfill-apcu": "^1.0", // v1.2.0
"sensio/distribution-bundle": "^5.0", // v5.0.12
"sensio/framework-extra-bundle": "^3.0.2", // v3.0.16
"incenteev/composer-parameter-handler": "^2.0", // v2.1.2
"doctrine/doctrine-migrations-bundle": "^1.2", // v1.2.0
"snc/redis-bundle": "^2.0", // 2.0.0
"predis/predis": "^1.1", // v1.1.1
"composer/package-versions-deprecated": "^1.11" // 1.11.99
},
"require-dev": {
"sensio/generator-bundle": "^3.0", // v3.0.8
"symfony/phpunit-bridge": "^3.0", // v3.1.4
"doctrine/data-fixtures": "^1.1", // 1.3.3
"hautelook/alice-bundle": "^1.3" // v1.4.1
}
}
8 Comments
Hi guys, I've modified 'app/Resources/views/default/index.html.twig' in VM, then I run `ansible-playbook ansible/playbook.yml -i ansible/hosts.ini -t deploy` and my changes have gone (file 'app/Resources/views/default/index.html.twig' does not contain changes). What am I doing wrong? Looks like ansible deploy task ('Checkout Git repository') returns it to its original state
Suppose, in theory, I should commit and push changes in repo before run this task?
Hey Dmitriy,
Sure, you should avoid uncommitted changes in your repo before running playbooks that have Git module. Or you need to improve your playbook to skip Git checkout if there's uncommitted changes, but this I'd not recommend because you would need to double check if Git was checked or no manually. So, I think better to commit changes first and then run the playbook. And I think it makes sense, you probably want to deploy only when all the changes you made are committed into the repo to deliver it to host.
Cheers!
Ansible fails constantly on this command:
vagrant@vagrant-ubuntu-trusty-64:/var/www/project$ ls -ld var
drwxrwxrwx 5 vagrant vagrant 4096 Oct 12 19:51 var
vagrant@vagrant-ubuntu-trusty-64:/var/www/project$ ls -lR var
var:
total 104
-rwxrwxrwx 1 vagrant vagrant 55029 Oct 12 19:51 bootstrap.php.cache
drwxrwxrwx 2 vagrant vagrant 4096 Oct 12 19:53 cache
drwxrwxrwx 2 vagrant vagrant 4096 Oct 12 19:51 logs
drwxrwxrwx 4 vagrant vagrant 4096 Oct 12 19:51 sessions
-rwxrwxrwx 1 vagrant vagrant 34155 Oct 12 19:51 SymfonyRequirements.php
var/cache:
total 0
var/logs:
total 12
-r-xr-xr-x 1 vagrant vagrant 9772 Oct 12 19:51 dev.log
var/sessions:
total 8
drwxrwxrwx 2 vagrant vagrant 4096 Oct 12 19:51 dev
dr-xr-xr-x 2 www-data www-data 4096 Oct 12 19:51 prod
var/sessions/dev:
total 0
var/sessions/prod:
total 0
`Edit: nevermind, I see the problem: var/cache/prod was somewhen generated by the web server...
Hey Ivan,
Yes, files generated with web server will have different permissions. Btw, how did you fix the problem?
Cheers!
> how did you fix the problem?
I simply removed the folders owned by www-data :)
Hey Ivan,
Great, thanks for reaching back! I think it might be useful for other users.
Cheers!
Hi guys: why would you tags deploy for Move Compose globally when you just want to deploy your new code to server? Is this a one time thing when you install composer? I think most of time u just need to run composer install when you deploy ur new code to server.
Hey Jian,
Good question :) Actually, as Ryan said, this is debatable: you might consider Composer as a "Server setup" task, not deployment. It's up to you. But yeah, there's no a good reason to do it, especially if you're installing Composer globally. But it makes more sense if you do not want to install composer globally, i.e. just download composer.phar, use it and then remove it from the server at all. So fell free to remove deploy tag from tasks which install Composer and move it globally.
Cheers!
"Houston: no signs of life"
Start the conversation!