#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
php tools/release_preflight.php
bash scripts/build_staging.sh
find app tools tests -name '*.php' -print0 | xargs -0 -n1 php -l >/tmp/bcos-php-lint.txt
php tests/launch_release_static.php
php tests/launch_release_unit.php
mkdir -p storage/logs storage/private storage/quarantine storage/backups
chmod -R u+rwX,go-rwx storage
printf 'BCOS first-launch build completed.\n'
