├── LICENSE ├── README.md └── phpci-installer.sh /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Syed Irfaq R. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | PHPCI Installer 2 | ========================= 3 | [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) 4 | 5 | 6 | > [PHPCI][1] Installer for Laravel Homestead. 7 | > Simple shell script that automatically installs the [PHPCI][1] with no user interaction required on a Laravel Homestead box. 8 | 9 | ## Pre-Requisites 10 | 11 | - [Laravel Homestead][2] configured and running. 12 | 13 | ### Important! 14 | 15 | The script drops the `phpci` database if it already exists and creates a new one. So if you already have a database with such name, make sure to either rename it or change the database name by forking this repo before installation. 16 | 17 | ## Installation 18 | 19 | **1.** SSH into your Laravel Homestead Box (`homestead ssh`) and `cd` into Code/Projects Directory. 20 | 21 | **2.** If you're fine with the default config and don't want to make any changes, Just fire the following command & jump to step 3: 22 | 23 | ``` 24 | $ curl -sSL http://lk.gd/phpci-install | bash 25 | ``` 26 | 27 | **(Optional) Custom Config:** If you'd like to use custom config, pass the following arguments with appropriate values: 28 | 29 | ``` 30 | -s 31 | ``` 32 | 33 | All the above arguments are optional, you can set all or the each of the ones you want in same order. 34 | 35 | **Example**: 36 | 37 | ``` 38 | $ curl -sSL http://lk.gd/phpci-install | bash -s phpci.vm phpci@homestead.vm 123456 phpci 39 | ``` 40 | 41 | **3.** Open the `/etc/hosts` file on your main machine and add `192.168.10.10 phpci.app` where `192.168.10.10` is the default IP of your homestead box and `phpci.app` is the default domain to access PHPCI or the one you passed in step 2 otherwise. 42 | 43 | **4.** Go to [http://phpci.app](http://phpci.app) and Login into the panel using the login credentials shown at the end of the installation or the default. 44 | 45 | **5.** **(Optional)** You can follow the [PHPCI wiki](https://github.com/Block8/PHPCI/wiki) for other configurations. 46 | 47 | ## Default Config 48 | 49 | 1. Default directory - `phpci` 50 | 2. Default domain - `phpci.app` 51 | 3. Database - Creates `phpci` database and uses `homestead` user with default password. 52 | 4. Admin Email: `phpci@homestead.vm` 53 | 5. Admin Password: `secret` 54 | 55 | > **Note:** The script uses the standard homestead `create-mysql.sh` script to create the database. 56 | 57 | 58 | ## Additional information 59 | 60 | Any issues, please [report here](https://github.com/irazasyed/phpci-installer/issues) 61 | 62 | Inspired to create this script by this [tutorial](https://medium.com/@genealabs/how-to-install-phpci-in-homestead-5ee0b022e8be) by [Mike Bronner](https://medium.com/@genealabs) 63 | 64 | ## Contributions 65 | 66 | Contributions are welcome, Please create a PR. 67 | 68 | ## License 69 | 70 | [MIT](LICENSE) © [Syed Irfaq R.](http://lk.gd/irazasyed) 71 | 72 | [1]: https://www.phptesting.org/ 73 | [2]: http://laravel.com/docs/homestead 74 | -------------------------------------------------------------------------------- /phpci-installer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #------------------------------------------------------------------------------ 4 | # PHPCI Installer for Laravel Homestead 5 | #------------------------------------------------------------------------------ 6 | # 7 | # Project URL: https://github.com/irazasyed/phpci-installer 8 | # 9 | 10 | ################## 11 | # Default Config # 12 | ################## 13 | DEFAULT_DOMAIN=phpci.app 14 | DEFAULT_DIRNAME=phpci 15 | DB_NAME=phpci 16 | MYSQL_CONF=~/.my.cnf 17 | 18 | ################## 19 | # PHPCI Defaults # 20 | ################## 21 | ADMIN_EMAIL=phpci@homestead.vm 22 | ADMIN_PASSWORD=secret 23 | 24 | [[ "$1" ]] && DEFAULT_DOMAIN=$1 25 | [[ "$2" ]] && ADMIN_EMAIL=$2 26 | [[ "$3" ]] && ADMIN_PASSWORD=$3 27 | [[ "$4" ]] && DEFAULT_DIRNAME=$4 28 | 29 | DEFAULT_URL=http://$DEFAULT_DOMAIN 30 | DEFAULT_PATH=$PWD/$DEFAULT_DIRNAME 31 | 32 | # 33 | # Helper function to output in color 34 | # 35 | coloredEcho() { 36 | tput setaf $2; 37 | echo "$1"; 38 | tput sgr0; 39 | } 40 | 41 | info() { 42 | coloredEcho "$1" 2; 43 | } 44 | 45 | note() { 46 | coloredEcho "$1" 3; 47 | } 48 | 49 | info "****************************" 50 | info " Welcome to PHPCI Installer" 51 | info "****************************" 52 | 53 | # Download PHPCI & Run Composer Install 54 | info "Downloading and Installing PHPCI Dependencies." 55 | composer create-project block8/phpci $DEFAULT_PATH --keep-vcs --no-dev --prefer-dist 56 | cd $DEFAULT_PATH && composer du -o 57 | 58 | # Increase PHP Memory Limit 59 | info "Increasing PHP Memory Limit." 60 | sudo sed -i "s/memory_limit = .*/memory_limit = 1024M/" /etc/php5/cli/php.ini 61 | 62 | # Setup Database - Uses Homestead's standard create MySQL script. 63 | info "Setting up MySQL Database." 64 | sudo bash /vagrant/scripts/create-mysql.sh $DB_NAME 65 | 66 | info "Adding MySQL Config." 67 | touch $MYSQL_CONF 68 | cat >$MYSQL_CONF <