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

Resolve L2SS-1812

parent 6e6aa0d7
Branches
No related tags found
1 merge request!886Resolve L2SS-1812
...@@ -11,13 +11,13 @@ repos: ...@@ -11,13 +11,13 @@ repos:
hooks: hooks:
- id: tox-black - id: tox-black
name: tox-black (local) name: tox-black (local)
entry: tox entry: bash
language: system language: system
args: ["-c", "tangostationcontrol/tox.ini", "-e", "black", "--"] args: ["-c", "cd tangostationcontrol; tox -e black"]
- repo: local - repo: local
hooks: hooks:
- id: tox-pep8 - id: tox-pep8
name: tox-pep8 (local) name: tox-pep8 (local)
entry: tox entry: bash
language: system 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. \ ...@@ -13,7 +13,6 @@ Station Control software related to Tango devices. \
* [Installation](#installation) * [Installation](#installation)
* [Prerequisites](#prerequisites) * [Prerequisites](#prerequisites)
* [Bootstrap](#bootstrap)
* [User documentation (ReadTheDocs (Sphinx / ReStructuredText))](tangostationcontrol/docs/README.md) * [User documentation (ReadTheDocs (Sphinx / ReStructuredText))](tangostationcontrol/docs/README.md)
* [Docker compose & station services documentation](docker-compose/README.md) * [Docker compose & station services documentation](docker-compose/README.md)
* [Jupyter startup files](docker-compose/jupyterlab/ipython-profiles/stationcontrol-jupyter/startup/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. \ ...@@ -33,14 +32,14 @@ Station Control software related to Tango devices. \
## Prerequisites ## Prerequisites
After checking out this repo, be sure to also check out the submodules After checking out this repo, be sure to install our git hooks and activate the virtual environment:
for this `git` needs to be installed:
```sh ```shell
git submodule init source setup.sh
git submodule update
``` ```
The file `/etc/docker/daemon.json` must exist on the host, create the folder and file if necessary.
You will also need: You will also need:
* docker * docker
...@@ -59,6 +58,7 @@ You will also need: ...@@ -59,6 +58,7 @@ You will also need:
* python3.10 * python3.10
* pip (python3-pip) * pip (python3-pip)
* tox (python3-tox) * tox (python3-tox)
* shyaml
On Ubuntu / Debian based systems these can typically be installed On Ubuntu / Debian based systems these can typically be installed
......
...@@ -2,4 +2,7 @@ ...@@ -2,4 +2,7 @@
# Copyright (C) 2022 ASTRON (Netherlands Institute for Radio Astronomy) # Copyright (C) 2022 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: Apache-2.0 # 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 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 #!/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 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 # --allow-missing-config: Allows the installation to proceed
# even if the configuration file is missing, and hooks won't be executed # 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 ...@@ -23,15 +23,14 @@ fi
# Activate the virtual environment # Activate the virtual environment
source "$VENV_DIR/bin/activate" source "$VENV_DIR/bin/activate"
# Install git post-checkout hook upon next execution of git command # Install git hooks
# git alias eventually automatically uninstalled
if [ ! -f "${LOFAR20_DIR}/.git/hooks/post-checkout" ]; then 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 fi
# Install git pre-push hook # Install git pre-commit pre-push hook
if [ ! -f "${LOFAR20_DIR}/.git/hooks/pre-push" ]; then if [ ! -f "${LOFAR20_DIR}/.git/hooks/pre-push.legacy" ]; then
source "${LOFAR20_DIR}/sbin/install-pre-commit.sh" source "${LOFAR20_DIR}/sbin/install-hooks/pre-commit.sh"
fi fi
# It checks if Tango is running within nomad, by trying to query the service from consul. # 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