#!/bin/bash

set -e

source "$(dirname "$0")/utils.sh"

section_start "install-deps" "Installing required dependencies"
bundle_install_script
yarn_install_script
section_end "install-deps"

section_start "assets-compile" "Compiling frontend assets"

# Upstream would check the cache file at "${GLCI_GITLAB_ASSETS_HASH_FILE}",
# (variable itself computed by a previous job and stransmitted via a dotenv
# artifact... Heptapod cache structure is vastly different, so we removed
# it entirely. But it's interesting to remember it as a good source of
# inspiration when we will decide to improve on caching.
bin/rake gitlab:assets:compile

section_end "assets-compile"
