Welcome Guest, Not a member yet? Register   Sign In
CI4 and GIT Files
#1

Hi,

I'm in the process of migrating a CI3 site to CI4 and am currently working on localhost. I haven't yet pushed anything to my test or production servers.

I've just noticed that date_helper.php is under vendor\codeigniter4\framework\system\Helpers

I also notice that vendor/ is in .gitignore

Will the helper be available when I push to test?  Confused
Reply
#2

Depends on how you push your files. Smile

The way this typically works is that you don't want to store all of the libraries in /vendor in your git application. This is the reason that folder is ignored. When working on it locally you can use Composer to install/update the files within vendor, including CodeIgniter itself.

Then, when you deploy, you could either use

a) a deploy script to push all files (including the vendor folder) up to the server
b) FTP all of the files
c) use something like GitHub actions to deploy all of the files for you on push to master.

The .gitignore file only tells git what to do, not other scripts, so however you choose to deploy it should deploy those files, yes.
Reply
#3

Thanks for this  Big Grin

My deployment process for CI3 is straight-forward; a simple git push of the localhost project folder to the target server git folder, and a git hook post-receive drops them into public_html.
Secure credentials are stored outwith public_html, updated via ssh using WinSCP and fetched using php file functions.

After reviewing your comments I've had to revise the process a little:

I've allowed the vendor folder to be pushed, but added dev dependencies to the .gitignore file.

I've had to change the document folder on cPanel to point to public and I upload the (appropriate) .env file via WinSCP.

All appeared to work, but then I changed the CI_ENVIROMENT setting from development to testing I got a database error which I tracked to the .env file - it looks you have to set database.tests instead of database.default  Confused 

When I come to deploy to production will I have to use database.production or can I use database.default?

Thanks again for your time.
(I think I may need to look at modern deployment fundamentals  Wink )
Reply
#4

(05-18-2021, 03:19 AM)paulkd Wrote: (I think I may need to look at modern deployment fundamentals  Wink )

Maybe I'm just an old fart, but I deploy my websites with "scp" and custom Bash shell scripts that zip and unzip .tar.gz files. I think that the modern deployment tools are overkill for my personal needs.  Blush
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply
#5

(05-19-2021, 04:01 PM)includebeer Wrote:
(05-18-2021, 03:19 AM)paulkd Wrote: (I think I may need to look at modern deployment fundamentals  Wink )

Maybe I'm just an old fart, but I deploy my websites with "scp" and custom Bash shell scripts that zip and unzip .tar.gz files. I think that the modern deployment tools are overkill for my personal needs.  Blush

And then there's the "modern" Javascript deployment  Dodgy  with CSS catching up at the rear  Wink
Reply




Theme © iAndrew 2016 - Forum software by © MyBB