Page MenuHomeDevCentral

build.sh
No OneTemporary

build.sh

#!/bin/sh
# -------------------------------------------------------------
# Build and promote nasqueron-reports Python package
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: BSD-2-Clause
# Source file: roles/reports/reports/files/build.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
set -e
# -------------------------------------------------------------
# Virtual environment
#
# :: Initialize
# :: Build
# :: Clean up
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
tmp_venv=$(mktemp -d -t reports-build)
python3 -m venv "$tmp_venv"
# shellcheck source=/dev/null
. "$tmp_venv/bin/activate"
pip install --upgrade pip
cd /opt/nasqueron-reports/tools/nasqueron-reports
pip install -r requirements.txt
pip install setuptools build
python3 -m build
deactivate
rm -rf "$tmp_venv"
# -------------------------------------------------------------
# Promote build
#
# :: Search .whl
# :: Copy to /dist
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
latest_package=$(find dist -name '*.whl' | sort | tail -n1)
if [ -z "$latest_package" ]; then
echo "No build artifact found in dist/" >&2
exit 1
fi
mkdir -p /opt/nasqueron-reports/dist
cp "$latest_package" /opt/nasqueron-reports/dist/nasqueron_reports-0.0.0.dev0-py3-none-any.whl

File Metadata

Mime Type
text/x-shellscript
Expires
Sun, Nov 16, 13:04 (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3170155
Default Alt Text
build.sh (1 KB)

Event Timeline