Skip to content
Snippets Groups Projects
Commit 92924867 authored by Corné Lukken's avatar Corné Lukken
Browse files

Resolve L2SS-1812

parent 6e6aa0d7
Branches
Tags
1 merge request!886Resolve L2SS-1812
......@@ -11,13 +11,13 @@ repos:
hooks:
- id: tox-black
name: tox-black (local)
entry: tox
entry: bash
language: system
args: ["-c", "tangostationcontrol/tox.ini", "-e", "black", "--"]
args: ["-c", "cd tangostationcontrol; tox -e black"]
- repo: local
hooks:
- id: tox-pep8
name: tox-pep8 (local)
entry: tox
entry: bash
language: system
args: ["-c", "tangostationcontrol/tox.ini", "-e", "pep8", "--"]
args: ["-c", "cd tangostationcontrol; tox -e pep8"]
......@@ -13,7 +13,6 @@ Station Control software related to Tango devices. \
* [Installation](#installation)
* [Prerequisites](#prerequisites)
* [Bootstrap](#bootstrap)
* [User documentation (ReadTheDocs (Sphinx / ReStructuredText))](tangostationcontrol/docs/README.md)
* [Docker compose & station services documentation](docker-compose/README.md)
* [Jupyter startup files](docker-compose/jupyterlab/ipython-profiles/stationcontrol-jupyter/startup/README.md)
......@@ -33,14 +32,14 @@ Station Control software related to Tango devices. \
## Prerequisites
After checking out this repo, be sure to also check out the submodules
for this `git` needs to be installed:
After checking out this repo, be sure to install our git hooks and activate the virtual environment:
```sh
git submodule init
git submodule update
```shell
source setup.sh
```
The file `/etc/docker/daemon.json` must exist on the host, create the folder and file if necessary.
You will also need:
* docker
......@@ -59,6 +58,7 @@ You will also need:
* python3.10
* pip (python3-pip)
* tox (python3-tox)
* shyaml
On Ubuntu / Debian based systems these can typically be installed
......
......@@ -2,4 +2,7 @@
# Copyright (C) 2022 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: Apache-2.0
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-checkout' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; }
git lfs post-checkout "$@"
git submodule update --init
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-commit' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; }
git lfs post-commit "$@"
#!/bin/bash
# Copyright (C) 2024 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: Apache-2.0
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-merge' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; }
git lfs post-merge "$@"
git submodule update --init
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; }
git lfs pre-push "$@"
#!/bin/bash
if [ ! -f "setup.sh" ]; then
echo "pre-commit.sh must be executed with repository root as working directory!"
exit 1
fi
pip install pre-commit
pre-commit install --hook-type pre-push --allow-missing-config
pre-commit install --hook-type pre-push
# --allow-missing-config: Allows the installation to proceed
# even if the configuration file is missing, and hooks won't be executed
......
#!/bin/bash
# Copyright (C) 2024 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: Apache-2.0
if [ ! -f "setup.sh" ]; then
echo "submodule-and-lfs.sh must be executed with repository root as working directory!"
exit 1
fi
cp bin/hooks/* .git/hooks/
......@@ -23,15 +23,14 @@ fi
# Activate the virtual environment
source "$VENV_DIR/bin/activate"
# Install git post-checkout hook upon next execution of git command
# git alias eventually automatically uninstalled
# Install git hooks
if [ ! -f "${LOFAR20_DIR}/.git/hooks/post-checkout" ]; then
alias git="cp ${LOFAR20_DIR}/bin/update_submodules.sh ${LOFAR20_DIR}/.git/hooks/post-checkout; cp ${LOFAR20_DIR}/bin/update_submodules.sh ${LOFAR20_DIR}/.git/hooks/post-merge; unalias git; git"
source "${LOFAR20_DIR}/sbin/install-hooks/submodule-and-lfs.sh"
fi
# Install git pre-push hook
if [ ! -f "${LOFAR20_DIR}/.git/hooks/pre-push" ]; then
source "${LOFAR20_DIR}/sbin/install-pre-commit.sh"
# Install git pre-commit pre-push hook
if [ ! -f "${LOFAR20_DIR}/.git/hooks/pre-push.legacy" ]; then
source "${LOFAR20_DIR}/sbin/install-hooks/pre-commit.sh"
fi
# It checks if Tango is running within nomad, by trying to query the service from consul.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment