-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
162 changed files
with
5,646 additions
and
657 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/app/config/parameters.yml | ||
/app/docker/.env | ||
/build/ | ||
/Envoy.config.php | ||
/node_modules/ | ||
/old/ | ||
/phpunit.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* This file is only for configure the IDE PHPStorm | ||
*/ | ||
System.config({ | ||
// Resolve webpack alias | ||
'paths': { | ||
'@app/*': './app/Resources/assets/*', | ||
'@bonus/*': './src/BonusBundle/Resources/assets/*', | ||
'@chat/*': './src/ChatBundle/Resources/assets/*', | ||
'@match/*': './src/MatchBundle/Resources/assets/*', | ||
'@npm/*': './node_modules/*', | ||
'@user/*': './src/UserBundle/Resources/assets/*', | ||
'@vendor/*': './vendor/*', | ||
'@web/*': './web/*', | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
################################# | ||
# Don't edit this file ! # | ||
# Use Envoy.config.php instead # | ||
################################# | ||
|
||
@include('./Envoy.config.php') | ||
@servers(['web' => [$sshHost]]) | ||
|
||
@setup | ||
$current = $workdir . '/current'; | ||
$dirRepo = $workdir . '/git'; | ||
$dirShared = $workdir . '/shared'; | ||
$dirReleases = $workdir . '/releases'; | ||
$dirRelease = $dirReleases .'/'. date('YmdHis'); | ||
$dirLastRelease = $dirReleases . '/last'; | ||
@endsetup | ||
|
||
@macro('deploy') | ||
new_release | ||
composer | ||
npm | ||
cache | ||
assets | ||
database | ||
stop | ||
link_current | ||
start | ||
clear | ||
@endmacro | ||
|
||
####################### | ||
# Prepare the workdir # | ||
####################### | ||
@task('prepare') | ||
echo "Task : Prepare {{ $workdir }}"; | ||
mkdir -p {{ $dirShared }}/logs; | ||
mkdir -p {{ $dirShared }}/img/avatars; | ||
mkdir -p {{ $dirShared }}/img/boats; | ||
|
||
echo "Prepare git repository"; | ||
[ -d {{ $dirRepo }} ] && rm -rf {{ $dirRepo }}; | ||
mkdir -p {{ $dirRepo }}; | ||
cd {{ $dirRepo }}; | ||
|
||
echo "Clone {{ $repository }} into {{ $dirRepo }}"; | ||
git clone -q {{ $repository }} . | ||
@endtask | ||
|
||
|
||
######################## | ||
# Create a new release # | ||
######################## | ||
@task('new_release') | ||
echo "Task : Create new release"; | ||
mkdir -p {{ $dirRelease }}; | ||
|
||
echo "Update git (branch: {{ $branch }})"; | ||
cd {{ $dirRepo }}; | ||
git checkout -q {{ $branch }}; | ||
git reset -q --hard; | ||
git pull; | ||
echo "Last commit : $(git log --oneline -n1)"; | ||
|
||
echo "Copy files to new release"; | ||
git archive {{$branch}}|tar -x -C {{ $dirRelease }}; | ||
|
||
echo "Create links :"; | ||
[ -e {{ $dirShared }}/parameters.yml ] || cp {{ $dirRelease }}/app/config/parameters.yml.dist {{ $dirShared }}/parameters.yml; | ||
ln -vs {{ $dirShared }}/parameters.yml {{ $dirRelease }}/app/config/parameters.yml; | ||
rm -rf {{ $dirRelease }}/var/logs; | ||
ln -vs {{ $dirShared }}/logs {{ $dirRelease }}/var/logs; | ||
rm -rf {{ $dirRelease }}/var/avatars {{ $dirRelease }}/var/boats; | ||
ln -vs {{ $dirShared }}/img/avatars {{ $dirRelease }}/var/avatars; | ||
ln -vs {{ $dirShared }}/img/boats {{ $dirRelease }}/var/boats; | ||
rm -f {{ $dirReleases }}/last; | ||
ln -vs {{ $dirRelease }} {{ $dirReleases }}/last; | ||
|
||
echo "Fix right"; | ||
chmod -Rf 777 {{ $dirReleases }}/last/var; | ||
chgrp -Rf www-data {{ $dirReleases }}/last/; | ||
@endtask | ||
|
||
|
||
################### | ||
# Libs and assets # | ||
################### | ||
@task('composer') | ||
echo "Task : Composer"; | ||
cd {{ $dirLastRelease }}; | ||
composer install --no-progress --ansi --no-suggest --no-interaction; | ||
@endtask | ||
|
||
@task('assets') | ||
echo "Task : Assets"; | ||
cd {{ $dirLastRelease }}; | ||
./bin/console assets:install --env={{ $env }}; | ||
./bin/console maba:webpack:compile --env={{ $env }}; | ||
@endtask | ||
|
||
@task('npm') | ||
echo "Task : NPM"; | ||
cd {{ $dirLastRelease }}; | ||
yarn install --no-progress; | ||
@endtask | ||
|
||
|
||
############ | ||
# Database # | ||
############ | ||
@task('database') | ||
echo "Task : Update database"; | ||
cd {{ $dirLastRelease }}; | ||
./bin/console doctrine:migrations:migrate --env={{ $env }}; | ||
chmod -Rf 777 {{ $dirLastRelease }}/var; | ||
@endtask | ||
|
||
@task('fixtures') | ||
echo "Task : import fixtures"; | ||
cd {{ $dirLastRelease }}; | ||
./bin/console doctrine:fixtures:load --append --no-interaction --env={{ $env }}; | ||
@endtask | ||
|
||
|
||
############ | ||
# Releases # | ||
############ | ||
@task('link_current') | ||
echo "Create link to the current release"; | ||
rm -f {{ $current }}; | ||
ln -sv {{ $dirReleases }}/$(ls {{ $dirReleases }}|grep -e '^[0-9]'|tail -n 1) {{ $current }}; | ||
@endtask | ||
|
||
@task('rollback') | ||
rm -f {{ $current }}; | ||
ln -sv {{ $dirReleases }}/$(ls {{ $dirReleases }}|grep -e '^[0-9]'|tail -n 2|head -n 1) {{ $current }}; | ||
@endtask | ||
|
||
@task('clear') | ||
echo "Remove old releases"; | ||
cd {{ $dirReleases }} | ||
ls -r|grep -e '^[0-9]'|tail -n +{{ $nbRelease + 1 }}|xargs rm -rf; | ||
@endtask | ||
|
||
######### | ||
# Cache # | ||
######### | ||
@task('cache') | ||
echo "Clear cache"; | ||
cd {{ $dirLastRelease }}; | ||
./bin/console cache:clear --env={{ $env }}; | ||
chmod -Rf 777 {{ $dirLastRelease }}/var; | ||
@endtask | ||
|
||
@task('warmup') | ||
echo "Warmup cache"; | ||
cd {{ $dirLastRelease }}; | ||
./bin/console cache:warmup --env={{ $env }}; | ||
chmod -Rf 777 {{ $dirLastRelease }}/var; | ||
@endtask | ||
|
||
|
||
########## | ||
# Server # | ||
########## | ||
@task('restart') | ||
echo "Restart the Websocket server"; | ||
cd {{ $dirLastRelease }}; | ||
./bin/console redis:flushdb --client=ws_client --env=prod; | ||
sudo supervisorctl restart battleship; | ||
@endtask | ||
|
||
@task('start') | ||
echo "Start the Websocket server"; | ||
sudo supervisorctl start battleship; | ||
@endtask | ||
|
||
@task('stop') | ||
echo "Stop the Websocket server"; | ||
sudo supervisorctl stop battleship; | ||
|
||
echo "Clear Redis"; | ||
cd {{ $dirLastRelease }}; | ||
./bin/console redis:flushdb --client=ws_client --env=prod; | ||
@endtask | ||
|
||
@task('ping') | ||
echo "pong (work in {{ $workdir }} on $(hostname))"; | ||
@endtask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* This file contain variable for deploy the app | ||
* Read the doc in app/Resources/doc/envoy.md | ||
*/ | ||
global $sshHost; | ||
|
||
/** | ||
* SSH host (define in your ~/.ssh/config file) | ||
*/ | ||
$sshHost = 'battleship.domain.org'; | ||
|
||
/** | ||
* Workdir on the server | ||
*/ | ||
$workdir = '/home/battleship'; | ||
|
||
/** | ||
* Environment | ||
*/ | ||
$env = 'prod'; | ||
|
||
/** | ||
* Repository | ||
*/ | ||
$repository = 'https://github.com/matthieuy/battleship.git'; | ||
|
||
/** | ||
* Branch | ||
*/ | ||
$branch = 'develop'; | ||
|
||
/** | ||
* Number of release | ||
*/ | ||
$nbRelease = 5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,18 @@ | ||
TODO | ||
==== | ||
|
||
- [ ] Bugfix : | ||
- [ ] FlashError : scrollTop | ||
- [ ] Animation with scroll != 0 | ||
- [ ] Documentations : | ||
- [ ] Howto add a bonus | ||
- [ ] Add screenshot or gif | ||
- [ ] Add screenshot or gif | ||
- [ ] Game : | ||
- [ ] ISO view | ||
- [ ] Shortcuts | ||
- [ ] Bonus : | ||
- [ ] Make more bonus | ||
- [ ] Add some trigger for bonus | ||
- [ ] ISO view | ||
- [ ] Mobile : | ||
- [ ] Helper for weapon | ||
- [ ] Helper for weapon | ||
- [ ] Stats : | ||
- [ ] Register stats on event | ||
- [ ] Display user stats on profil | ||
- [ ] Display stats on game | ||
- [ ] Notifications : | ||
- [ ] Config per type on profil page | ||
- [ ] Notifications registry | ||
- [ ] Notifications manager | ||
- [ ] Transporter : | ||
- [ ] Hook | ||
- [ ] SMS (via hooks) | ||
- [ ] IonicPush | ||
- [ ] Discord | ||
- [ ] Push Navigator | ||
- [ ] Type : | ||
- [ ] User connect | ||
- [ ] Tour | ||
- [ ] Messages | ||
- [ ] Register stats on event | ||
- [ ] Display user stats on profil | ||
- [ ] Display stats on game | ||
- [ ] Translate : | ||
- [ ] Translate in French | ||
- [ ] Translate in French | ||
- [ ] Tests/Dev : | ||
- [ ] Unit tests | ||
- [ ] Script for deploy on git hook (personal TODO) | ||
- [ ] Page with websocket client | ||
- [ ] ESLint and others checks tools | ||
- [ ] Unit tests | ||
- [ ] ESLint and others checks tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.