#!/bin/bash

## Copyright (C) 2023 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

## This script is supposed to be run:
## - For official binary builds by a builder (developer).
## - For debug builds: (dm-virtualbox-build-debug)
## - By the CI.

set -x
set -e

MYDIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" && pwd )"
cd -- "$MYDIR"
cd ..

true "$0: START"

true "$0: checklist..."
df -h
sleep 2

## Debugging.
whoami
ls -la
pwd

if [ "$CI" = "true" ]; then
  ## fetch/merge git submodules
  ## CI testing of 'derivative-update'.
  ./derivative-update --update-only
fi

true "$0: --------------------"
./help-steps/dm-build-official-one "$@"
true "$0: --------------------"

true "$0: END"
