From db3ee03672fdc566d2eddf9efb4ba9071f37a9ee Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Tue, 27 Oct 2015 01:49:05 +0000 Subject: [PATCH] Add pip-and-virtualenv element This element allows installation of pip and virtualenv from either distro packages or git. Change-Id: Id294f0936c8fef8a3b27a415bfcc93b3f327e104 Depends-On: I731cc8a0f5bfeda8f17a78c33b9f44062323a361 --- elements/pip-and-virtualenv/README.rst | 12 ++++++++++++ elements/pip-and-virtualenv/element-deps | 2 ++ .../get-pip-py-source-install/01-install-pip | 10 ++++++++++ elements/pip-and-virtualenv/package-installs.yaml | 4 ++++ .../source-repository-pip-and-virtualenv | 1 + 5 files changed, 29 insertions(+) create mode 100644 elements/pip-and-virtualenv/README.rst create mode 100644 elements/pip-and-virtualenv/element-deps create mode 100755 elements/pip-and-virtualenv/install.d/get-pip-py-source-install/01-install-pip create mode 100644 elements/pip-and-virtualenv/package-installs.yaml create mode 100644 elements/pip-and-virtualenv/source-repository-pip-and-virtualenv diff --git a/elements/pip-and-virtualenv/README.rst b/elements/pip-and-virtualenv/README.rst new file mode 100644 index 00000000..5516ed0d --- /dev/null +++ b/elements/pip-and-virtualenv/README.rst @@ -0,0 +1,12 @@ +================== +pip-and-virtualenv +================== + +This element installs pip and virtualenv in the image. If the package +installtype is used then these programs are installed from distribution +packages. If the source installtype is used these programs are installed +from get-pip.py and pip (respectively). + +To install pip and virtualenv from package: + + export DIB_INSTALLTYPE_pip_and_virtualenv=package diff --git a/elements/pip-and-virtualenv/element-deps b/elements/pip-and-virtualenv/element-deps new file mode 100644 index 00000000..73d637d4 --- /dev/null +++ b/elements/pip-and-virtualenv/element-deps @@ -0,0 +1,2 @@ +package-installs +source-repositories diff --git a/elements/pip-and-virtualenv/install.d/get-pip-py-source-install/01-install-pip b/elements/pip-and-virtualenv/install.d/get-pip-py-source-install/01-install-pip new file mode 100755 index 00000000..31804aab --- /dev/null +++ b/elements/pip-and-virtualenv/install.d/get-pip-py-source-install/01-install-pip @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then + set -x +fi +set -eu +set -o pipefail + +python /tmp/get-pip.py +pip install virtualenv diff --git a/elements/pip-and-virtualenv/package-installs.yaml b/elements/pip-and-virtualenv/package-installs.yaml new file mode 100644 index 00000000..85c7f0eb --- /dev/null +++ b/elements/pip-and-virtualenv/package-installs.yaml @@ -0,0 +1,4 @@ +python-pip: + installtype: package +python-virtualenv: + installtype: package diff --git a/elements/pip-and-virtualenv/source-repository-pip-and-virtualenv b/elements/pip-and-virtualenv/source-repository-pip-and-virtualenv new file mode 100644 index 00000000..f26e3cc5 --- /dev/null +++ b/elements/pip-and-virtualenv/source-repository-pip-and-virtualenv @@ -0,0 +1 @@ +get-pip-py file /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py