-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from i386x/lsr-template-refactored--part-1
Onboard refactored tox & Travis CI setup and configuration vol. 1
- Loading branch information
Showing
3 changed files
with
38 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
# SPDX-License-Identifier: MIT | ||
export LSR_MOLECULE_DEPS='-rmolecule_requirements.txt' | ||
# | ||
# Use this file to specify custom configuration for a project. Generally, this | ||
# involves the modification of the content of LSR_* environment variables, see | ||
# | ||
# * .travis/preinstall: | ||
# | ||
# - LSR_EXTRA_PACKAGES | ||
# | ||
|
||
LSR_EXTRA_PACKAGES='python3-selinux' | ||
export LSR_MOLECULE_DEPS='-rmolecule_requirements.txt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,30 @@ | ||
#!/bin/bash | ||
# SPDX-License-Identifier: MIT | ||
|
||
set -ex | ||
# Install package specified by user in LSR_EXTRA_PACKAGES. Executed by Travis | ||
# during before_install phase. | ||
# | ||
# LSR_EXTRA_PACKAGES, set by user in .travis/config.sh, is a space separated | ||
# list of packages to be installed on the Travis build environment (Ubuntu). | ||
|
||
SCRIPTDIR=$(dirname $0) | ||
CONFIG=${SCRIPTDIR}/config.sh | ||
set -e | ||
|
||
if [[ -f ${CONFIG} ]]; then | ||
. ${CONFIG} | ||
SCRIPTDIR=$(readlink -f $(dirname $0)) | ||
|
||
. ${SCRIPTDIR}/utils.sh | ||
|
||
# Add python3-selinux package (needed by Molecule on selinux enabled systems, | ||
# because Molecule is using `copy` and `file` Ansible modules to setup the | ||
# container). | ||
if lsr_venv_python_matches_system_python; then | ||
LSR_EXTRA_PACKAGES='python3-selinux' | ||
fi | ||
|
||
. ${SCRIPTDIR}/config.sh | ||
|
||
# Install extra dependencies. | ||
if [[ "${LSR_EXTRA_PACKAGES}" ]]; then | ||
set -x | ||
sudo apt-get update | ||
for P in ${LSR_EXTRA_PACKAGES}; do | ||
sudo apt-get install -y ${P} || : | ||
done | ||
sudo apt-get install -y ${LSR_EXTRA_PACKAGES} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters