Samuli Silvius | cceed25 | 2019-04-16 15:41:26 +0300 | [diff] [blame] | 1 | #! /usr/bin/env bash |
| 2 | |
| 3 | # COPYRIGHT NOTICE STARTS HERE |
| 4 | |
| 5 | # Copyright 2019 © 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 |
Mateusz Pilat | b0f546a | 2019-05-08 13:33:46 +0200 | [diff] [blame] | 36 | python3.6 -m venv ${VENV_PATH} |
Samuli Silvius | cceed25 | 2019-04-16 15:41:26 +0300 | [diff] [blame] | 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 install molecule==2.20 ansible==2.7.8 docker pyopenssl |
| 45 | fi |