-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·29 lines (23 loc) · 1.03 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
# This script prepares all dependent files to be deployed to server as a single .tar file
# This script intended to be executed in Jenkins CI, but likelly to be extended by you.
set -e # Stop on error
set -x # Show commands being executed
# Downloading dependencies and building frontend
APP_ENV=prod composer install --no-dev --no-scripts --no-interaction --optimize-autoloader
yarn
# Generate trasnlation JSON files from YAML (to be used by Encore)
bin/console bazinga:js-translation:dump assets/js --format=json --merge-domains --quiet --env=prod
# Build JavaScript assets
yarn run encore production
# <-- This is a good place to add custom commands for your project
php bin/console assets:install --env=prod
# Generating deployment artifact (one file with everything you need to be deployed on the server)
tar czf project.tar.gz --owner 0 --group 0 --anchored $( \
ls -a | tail -n +3 \
| grep -v "node_modules" \
| grep -v ".git" \
| grep -v ".deploy" \
| grep -v ".docker" \
| grep -v ".idea" \
)