Skip to content

Commit

Permalink
Merge pull request #354 from statikbe/run_frontend_build_in_pipeline
Browse files Browse the repository at this point in the history
Added frontend build to bitbucket pipeline for faster building
  • Loading branch information
Numkil authored Jun 20, 2024
2 parents 13e16e3 + 52349e5 commit f1f144f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions bitbucket_pipelines_build_frontend.sh
Original file line number Diff line number Diff line change
@@ -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
9 changes: 1 addition & 8 deletions deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
'exclude' => [
'.git',
'deploy.php',
'node_modules',
'public/frontend'
'node_modules'
],
'exclude-file' => false,
'include' => [],
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -161,7 +155,6 @@
'craft:clear_caches',
'statik:copy_htaccess',
'statik:copy_robots',
'statik:frontend_build',
'statik:fichenbak_versioning',
'deploy:publish',
]);
Expand Down

0 comments on commit f1f144f

Please sign in to comment.