[MOLECULE] Pin the ansible-lint pip package
[oom/offline-installer.git] / ansible / test / bin / install-molecule.sh
1 #! /usr/bin/env bash
2
3 #   COPYRIGHT NOTICE STARTS HERE
4
5 #   Copyright 2019-2021 © Samsung Electronics Co., Ltd.
6 #
7 #   Licensed under the Apache License, Version 2.0 (the "License");
8 #   you may not use this file except in compliance with the License.
9 #   You may obtain a copy of the License at
10 #
11 #       http://www.apache.org/licenses/LICENSE-2.0
12 #
13 #   Unless required by applicable law or agreed to in writing, software
14 #   distributed under the License is distributed on an "AS IS" BASIS,
15 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 #   See the License for the specific language governing permissions and
17 #   limitations under the License.
18
19 #   COPYRIGHT NOTICE ENDS HERE
20
21 #
22 # Pre-requisites:
23 #  - python 3
24 #  - pip
25 #  - dev tools (libssl-dev in particular)
26 #  - venv
27 #
28 # Example install in Ubuntu 18.04
29 #   sudo apt install -y python3-pip
30 #   sudo apt install build-essential libssl-dev libffi-dev python3-dev
31 #   sudo apt install -y python3-venv
32 #
33 VENV_PATH=${VENV_PATH:-~/molecule_venv}
34
35 # Create virtual env
36 python3.8 -m venv ${VENV_PATH}
37
38 # Activate virtual env
39 source ${VENV_PATH}/bin/activate
40
41 # Install Molecule
42 if [ ! -z ${VIRTUAL_ENV} ]; then
43     echo "Activated virtual env in ${VIRTUAL_ENV}"
44     pip -q install -U pip
45     pip -q install ansible-lint==5.4.0 molecule==3.3.0 Jinja2==2.11.3 ansible-base==2.10.8 ansible==3.2.0 docker molecule-docker==0.2.4 pytest-testinfra yamllint flake8 markupsafe==2.0.1
46 fi