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!
10.
git & Variables
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
}
}
14 Comments
I am using the repo link https://github.com/symfony/... for symfony 5. It seems like it is missing the bin/console. I have tried composer require symfony/console but still don't get it.
Just wanted to know if there should be a different way to do the installation for symfony and on wards?
Hey Abdul mannan
Here is a tip https://symfony.com/doc/cur...
You can use both ways described in docs it works perfectly!
Cheers!
Hi , I would like to ask a Q, i have updated some code in vendor bundle , Is there a way to avoid updating this bundle from composer when I do deployment. Thnx
Hey Boran,
Sounds not good. Do you mean you did some changes manually in vendor/ directory? If so, that's not the correct way, you should never change directly any third-party code which is inside vendor/ dir - it's totally unsafe to do as you can see. The proper way is to send a PR to the package owner if your changes fix or improve some things, but if you need to make changes related only to your project, you can fork that package, do the changes you need in the fork and then points Composer to your fork with provided fix. If you need more info about it - I can provide a simple example.
But back to your question, if you modify vendor dir (which is very bad as I mentioned) - you're not able to run composer install/update commands anymore. The only way to deploy this broken application is to upload the entire vendor/ directory to the host. But that's a bad idea.
Cheers!
Hi Victor ,
thanks for your Answer , I have modified this code in order to be compatible with the system requirement , not to fix a bug , could you please give me an example how i can avoid that.
Best Regards ,
Hey Boran,
If it might be helpful for others - I think you can suggest your changes to be included in the repo by sending a PR.
What about example, you can tell Composer to look at your fork by specifying URL to your forked repo in composer.json this way:
Where "https://github.com/your-github-nickname/package-name.git" is a link to your fork of the repo. In "require" section you need to just tweak the version constraint of this package, the name remains the same, for example, if you push changes to master, than you need to use "dev-master" instead of constraint like "^v1.2.3".
Cheers!
I looked into the finished Ansistrano Zip File. We additionally added mode: 0775 to the "Create project directory" module; What does this actually mean?
Hey Chris,
If you're wondering about that magical 0775 number - it's a permissions level in Linux OS, where "77" means you allow to read/write/execute for owners and groups, and "5" means you allow to read/execute only for others. So with that task we create a project directory with "755" permissions. If you want more information - read about chmod linux command: https://en.wikipedia.org/wi...
Cheers!
hi Guys:
When I checkout bitbucket, it will require me to enter my account password my checkout will stuck forever and waiting me to enter password. How Do I automatic that in Ansible?
Hey Jian,
Unfortunately, Ansible not able to fill interactive user prompts, that's why we add "--no-interactive" option in some Symfony commands. So you need to handle private repositories in a bit different way, i.e. use SSH key - you can add it in Bitbucket Settings / SSH keys. Also Bitbucket has another cool feature: "Access keys" - in your *repository* settings go to "Access keys" and add one. This access keys provide read-only access to your repository which is perfect for deployment.
Cheers!
well, that is kinda suck. For pulling down bitbucket I can use SSH keys no problem. Think about this situation. In a large enterprise, it is reasonable to ask sysadmins to have different passwords on each node. let's say have different passwords on 1000 nodes. Implementing that would be near impossible. we need a solution to store those keys or password inside Ansible , then when we deploy 1000 nodes we don't need to enter password. when configure server, you need to do alot interactive user prompts for other tasks. Just my thought and I think this is valid question.
Hey Jian,
Ansible has a really great solution for it - the Vault, which helps you to store sensitive data like your DB credentials, passwords, secret tokens, etc. - you will discover it a bit later in this course, check it out here: https://knpuniversity.com/s... . But if we talk about connection to the server - you probably won't use plain passwords. Instead, SSH key is something that you need. And anyway, you need to configure connection to each of 1000 servers if they have different passwords / SSH keys on them.
Cheers!
Hey Victor,
can you do a course on Continuous Integration of a Symfony project with Jenkins ?
Hey Nizar!
Interesting idea! We currently use CircleCI for our continuous integration on SymfonyCasts... and GitHub actions is gaining popularity fast for the same thing (and i use that for many of my open source libraries). These are both "hosted", so they're easier to use than Jenkins (but of course, it will cost you some money). I don't see Jenkins being used nearly as often as it was a few years ago.
Let me know if this helps :).
Cheers!
"Houston: no signs of life"
Start the conversation!