Skip to content

Commit

Permalink
Added frontend build to bitbucket pipeline for faster building
Browse files Browse the repository at this point in the history
  • Loading branch information
kristofser committed Jun 3, 2024
1 parent 117b33f commit 3797151
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 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
6 changes: 0 additions & 6 deletions deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,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 +156,6 @@
'craft:clear_caches',
'statik:copy_htaccess',
'statik:copy_robots',
'statik:frontend_build',
'statik:fichenbak_versioning',
'deploy:publish',
]);
Expand Down

0 comments on commit 3797151

Please sign in to comment.