Permalink
Browse files

Cleanup Makefile

  • Loading branch information...
REBELinBLUE committed Jan 22, 2017
1 parent e7a5d78 commit 925dc773e5af20cc49b324da89b7eb92c19a97f7
View
@@ -1,12 +1,3 @@
-.PHONY: deps
-
-test: lint phpcs phpdoccheck phpunit phpmd
-
-build:
- composer install --no-suggest --prefer-dist
- yarn install
- gulp
-
deps:
composer install -o --no-dev --no-suggest --prefer-dist
yarn install --production
@@ -15,6 +6,11 @@ dev-deps:
composer install --no-suggest --prefer-dist
yarn install
+test: lint phpcs phpdoccheck phpunit phpmd
+
+build: dev-deps
+ gulp
+
phpcs:
./vendor/bin/phpcs -n --standard=phpcs.xml
@@ -34,11 +30,13 @@ clean:
rm -rf ./{vendor,node_modules,bower_components}/
rm -rf ./storage/logs/*.log
rm -rf ./storage/framework/{cache,sessions,views}/*
- rm -rf ./public/{css,fonts,js
+ rm -rf ./storage/clockwork/*
+ rm -rf ./public/{css,fonts,js}
rm -rf ./_ide_helper{_models,}.php
rm -rf ./.phpstorm.meta.php
rm -rf ./.php_cs.cache
reset: clean
- rm -rf ./public/{build}
+ rm -rf ./public/build
rm -rf ./storage/app/{mirrors,tmp}/*
+ rm -rf .env.prev
@@ -120,7 +120,7 @@ public function handle()
'Setup the cronjobs, see <options=bold>crontab</>',
'Setup the socket server & queue runner, see <options=bold>supervisor.conf</> for an example setup',
'Ensure that <options=bold>storage</> and <options=bold>public/upload</> are writable by the webserver',
- 'Visit ' . $config['app']['url'] . ' and login with the details you provided to get started',
+ 'Visit <options=bold>' . $config['app']['url'] . '</> & login with the details you provided to get started',
];
foreach ($instructions as $i => $instruction) {
View
@@ -1,17 +0,0 @@
-# Ansible example
-
-Here's an example of an Ansible set up the deployer tool in a server with Ubuntu Server installed.
-
-## Set up variables
-
- - In the hosts file change the IP address and replace it with your production server.
-
- - In the group_vars/production.yml file customize the vhost domain
-
- - In the vars/server.yml file you can change what version of the deployer is going to be installed
-
-## Launch ansible
-
-```
-ansible-playbook -i hosts playbook.yml --limit colt
-```
@@ -1,10 +0,0 @@
-# Customize the domain for your application. Remember that you will need to either create a dns record or modify your hosts file
-www_domain: deployer.app
-
-www_document_root: /var/www/deployer/public
-deployer_directory: /var/www/deployer
-php_fcgi_port: 9000
-php_display_errors: On
-php_display_startup_errors: On
-php_error_reporting: E_ALL & ~E_DEPRECATED & ~E_STRICT
-php_request_slowlog_time: 30s
View
@@ -1,2 +0,0 @@
-[production]
-127.0.0.1
@@ -1,11 +0,0 @@
----
-- hosts: all
- sudo: yes
- vars_files:
- - vars/server.yml
- roles:
- - { role: server, tags: ['server'] }
- - { role: mysql, tags: ['database'] }
- - { role: nginx, tags: ['webserver', 'nginx'] }
- - { role: php, tags: ['webserver'] }
- - { role: deployer, tags: ['webserver'] }
@@ -1,6 +0,0 @@
----
-- name: stop supervisor
- service: name=supervisor state=stopped
-
-- name: start supervisor
- service: name=supervisor state=started
@@ -1,56 +0,0 @@
----
-- name: Get deployer from repository
- git: repo="https://github.com/REBELinBLUE/deployer.git" dest={{deployer_directory}} version={{deployer_version}} force=yes update=yes
- register: version_modified
-
-- name: Install deployer dependencies (Composer)
- composer: command="install" no_dev=yes optimize_autoloader=yes working_dir={{deployer_directory}}
- when: version_modified.changed
-
-- name: Install deployer dependencies (NPM)
- npm: path={{deployer_directory}} production=yes
- when: version_modified.changed
-
-- name: Set writable permissions for public directories
- file: path={{item}} mode=0777 recurse=yes state=directory
- with_items:
- - "{{deployer_directory}}/storage"
- - "{{deployer_directory}}/public/upload"
-
-- name: Check if deployer configuration file exists
- stat: path={{deployer_directory}}/.env
- register: configuration_exists
-
-- name: Install deployer configuration file
- template: src=env.deployer.j2 dest={{deployer_directory}}/.env
-
-- name: Run scripts to complete deployer installation
- shell: "{{item}}"
- args:
- chdir: "{{deployer_directory}}"
- with_items:
- - "php artisan clear-compiled"
- - "php artisan cache:clear"
- - "php artisan route:clear"
- - "php artisan config:clear"
- - "php artisan view:clear"
- - "php artisan optimize --force"
- - "php artisan key:generate"
- - "php artisan jwt:generate"
- - "php artisan config:cache"
- - "php artisan route:cache"
- - "php artisan migrate --force"
- - "npm install --production"
-
-- name: Update deployer
- shell: 'printf \"\yes\" | php artisan app:update'
- args:
- chdir: "{{deployer_directory}}"
- when: (configuration_exists.stat.exists == True and version_modified.changed == True)
-
-- name: Create Deployer cron job
- cron: name="Deployer schedule" job="sudo php {{deployer_directory}}/artisan schedule:run 1>> /dev/null 2>&1"
-
-- name: Create supervisor configuration file
- template: src=deployer.conf.j2 dest=/etc/supervisor/conf.d/deployer.conf
- notify: start supervisor
@@ -1,37 +0,0 @@
-[program:deployer]
-command=php artisan queue:work --queue=deployer-high,deployer-low --sleep=3 --tries=1 --daemon
-directory=/var/www/deployer
-process_name=queue_%(process_num)s
-numprocs=3
-numprocs_start=0
-stdout_logfile=/var/www/deployer/storage/logs/supervisord-%(process_num)s-stdout.log
-stderr_logfile=/var/www/deployer/storage/logs/supervisord-%(process_num)s-stderr.log
-stderr_logfile_maxbytes=1MB
-stdout_logfile_maxbytes=1MB
-redirect_stderr=true
-autostart=true
-autorestart=true
-
-[program:deployer-socketio]
-command=nodejs socket.js
-directory=/var/www/deployer
-numprocs=1
-autostart=true
-autorestart=true
-environment=NODE_ENV=production
-stderr_logfile=/var/www/deployer/storage/logs/node-stderr.log
-stdout_logfile=/var/www/deployer/storage/logs/node-stdout.log
-stderr_logfile_maxbytes=1MB
-stdout_logfile_maxbytes=1MB
-
-[program:deployer-broadcast]
-command=php artisan queue:work --queue=deployer-default --sleep=3 --tries=1 --daemon
-directory=/var/www/deployer
-numprocs=1
-stderr_logfile=/var/www/deployer/storage/logs/broadcast-stderr.log
-stdout_logfile=/var/www/deployer/storage/logs/broadcast-stdout.log
-stderr_logfile_maxbytes=1MB
-stdout_logfile_maxbytes=1MB
-redirect_stderr=true
-autostart=true
-autorestart=true
@@ -1,33 +0,0 @@
-APP_ENV=production
-APP_DEBUG=false
-APP_KEY=
-APP_URL=http://{{www_domain}}
-APP_TIMEZONE=Europe/Madrid
-APP_LOCALE=en
-APP_THEME=green
-
-SOCKET_URL=http://{{www_domain}}
-SOCKET_PORT=6001
-
-JWT_SECRET=
-
-DB_CONNECTION=mysql
-DB_HOST=localhost
-DB_DATABASE={{database_deployer_name}}
-DB_USERNAME={{database_deployer_user}}
-DB_PASSWORD={{database_deployer_pwd}}
-
-MAIL_DRIVER=sendmail
-MAIL_FROM_ADDRESS=deployer@enalquiler.com
-MAIL_FROM_NAME=Deployer
-
-REDIS_HOST=127.0.0.1
-REDIS_PORT=6379
-
-QUEUE_DRIVER=beanstalkd
-QUEUE_HOST=localhost
-
-CACHE_DRIVER=file
-SESSION_DRIVER=file
-IMAGE_DRIVER=gd
-LOGGING_MODE=daily
@@ -1,28 +0,0 @@
-; supervisor config file
-
-[unix_http_server]
-file=/var/run/supervisor.sock ; (the path to the socket file)
-chmod=0700 ; sockef file mode (default 0700)
-
-[supervisord]
-logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
-pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
-childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
-
-; the below section must remain in the config file for RPC
-; (supervisorctl/web interface) to work, additional interfaces may be
-; added by defining them in separate rpcinterface: sections
-[rpcinterface:supervisor]
-supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
-
-[supervisorctl]
-serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
-
-; The [include] section can just contain the "files" setting. This
-; setting can list multiple files (separated by whitespace or
-; newlines). It can also contain wildcards. The filenames are
-; interpreted as relative to this file. Included files *cannot*
-; include files themselves.
-
-[include]
-files = /etc/supervisor/conf.d/*.conf
@@ -1,9 +0,0 @@
----
-- name: Install MySQL Server
- apt: name=mysql-server={{mysql_version}}
-
-- name: Create database
- mysql_db: name={{database_deployer_name}}
-
-- name: Add MySQL user
- mysql_user: name={{database_deployer_user}} password={{database_deployer_pwd}} priv={{database_deployer_name}}.*:ALL,GRANT
@@ -1,9 +0,0 @@
-<IfModule mod_fastcgi.c>
- AddHandler php5.fcgi .php
- Action php5.fcgi /php5.fcgi
- Alias /php5.fcgi /usr/lib/cgi-bin/php5.fcgi
- FastCgiExternalServer /usr/lib/cgi-bin/php5.fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization -idle-timeout 3600
- <Directory /usr/lib/cgi-bin>
- Require all granted
- </Directory>
-</IfModule>
@@ -1,3 +0,0 @@
----
-- name: restart nginx
- service: name=nginx state=restarted
@@ -1,7 +0,0 @@
----
-- name: Install Nginx
- apt: name=nginx-full={{nginx_version}}
-
-- name: Add site virtual host
- template: src=vhost.conf.j2 dest=/etc/nginx/sites-available/default
- notify: restart nginx
@@ -1,48 +0,0 @@
-upstream websocket {
- server 127.0.0.1:6001;
-}
-
-server {
- listen 80;
- server_name {{www_domain}};
- root {{ www_document_root }};
-
- index index.php;
-
- charset utf-8;
-
- location / {
- try_files $uri $uri/ /index.php?$query_string;
- }
-
- access_log off;
- error_log /var/log/nginx/deploy.app-error.log error;
-
- sendfile off;
-
- client_max_body_size 100m;
-
- location ~ \.php$ {
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_index index.php;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_intercept_errors off;
- fastcgi_buffer_size 16k;
- fastcgi_buffers 4 16k;
- }
-
- location /socket.io {
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_http_version 1.1;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $host;
- proxy_pass http://websocket;
- }
-
- location ~ /\.ht {
- deny all;
- }
-}
@@ -1,8 +0,0 @@
----
-- name: Download NodeJS installer
- shell: "curl --silent --location https://deb.nodesource.com/setup_4.x | bash -"
- args:
- creates: "/usr/bin/nodejs"
-
-- name: Install NodeJS
- apt: name=nodejs state=latest
Oops, something went wrong.

0 comments on commit 925dc77

Please sign in to comment.