diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 4c56fa04..786bdf39 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -11,6 +11,7 @@ pipelines: script: # build frontend and run composer - composer install --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader + - sh ./bitbucket_pipelines_build_frontend.sh # deploy: - cp .deploy/ssh/* ~/.ssh/. && chmod 400 ~/.ssh/bitbucket_pipelines* - dep deploy staging -vv diff --git a/bitbucket_pipelines_build_frontend.sh b/bitbucket_pipelines_build_frontend.sh new file mode 100644 index 00000000..554b472a --- /dev/null +++ b/bitbucket_pipelines_build_frontend.sh @@ -0,0 +1,9 @@ +#!bin/bash + +# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash +export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" +nvm install && nvm use +npm install -g yarn +yarn install +yarn prod diff --git a/deploy.php b/deploy.php index 92249f48..78065e46 100644 --- a/deploy.php +++ b/deploy.php @@ -52,8 +52,7 @@ 'exclude' => [ '.git', 'deploy.php', - 'node_modules', - 'public/frontend' + 'node_modules' ], 'exclude-file' => false, 'include' => [], @@ -100,11 +99,6 @@ run('{{release_path}}/craft clear-caches/all'); })->once(); -desc('Frontend build'); -task('statik:frontend_build', function () { - run('cd {{release_path}} && yarn install && yarn run prod'); -})->once(); - desc('Fichenbak versioning'); task('statik:fichenbak_versioning', function () { run('if [ -s {{release_path}}/fichenbak-versioning.sh ]; then sh {{release_path}}/fichenbak-versioning.sh; fi'); @@ -161,7 +155,6 @@ 'craft:clear_caches', 'statik:copy_htaccess', 'statik:copy_robots', - 'statik:frontend_build', 'statik:fichenbak_versioning', 'deploy:publish', ]);