[MediaWiki-commits] [Gerrit] labs...deploy[master]: Add scap3 check to create/update virtualenv

2016-07-28 Thread BryanDavis (Code Review)
BryanDavis has submitted this change and it was merged.

Change subject: Add scap3 check to create/update virtualenv
..


Add scap3 check to create/update virtualenv

(Ab)use the scap3 checks system to introduce a script that will ensure
that an up to date virtualenv is available during the promote stage of
each deployment. Modeled on similar usage in research/ores/deploy.git.

Change-Id: Ib84e89114a07330c105876bcf7ee360135f5bcdd
---
A scap/checks.yaml
A scap/checks/virtualenv.sh
2 files changed, 28 insertions(+), 0 deletions(-)

Approvals:
  BryanDavis: Verified; Looks good to me, approved
  Thcipriani: Looks good to me, but someone else must approve



diff --git a/scap/checks.yaml b/scap/checks.yaml
new file mode 100644
index 000..21ac7c7
--- /dev/null
+++ b/scap/checks.yaml
@@ -0,0 +1,8 @@
+---
+checks:
+  virtualenv:
+type: command
+stage: promote
+timeout: 300
+group: default
+command: bash /srv/deployment/striker/deploy/scap/checks/virtualenv.sh
diff --git a/scap/checks/virtualenv.sh b/scap/checks/virtualenv.sh
new file mode 100755
index 000..2778a57
--- /dev/null
+++ b/scap/checks/virtualenv.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+# Create/update a python virtualenv using the wheel binaries
+set -o errexit
+set -o nounset
+set -o pipefail
+
+VENV=/srv/deployment/striker/venv
+DEPLOY_DIR=/srv/deployment/striker/deploy
+
+PIP=${VENV}/bin/pip
+
+# Ensure that the virtual environment exists
+mkdir -p $VENV
+virtualenv --python python3 --system-site-packages $VENV
+
+# Remove all existing packages from the venv
+$PIP freeze | xargs $PIP uninstall -y
+
+# Install all of the packaged wheels
+$PIP install --use-wheel --no-deps ${DEPLOY_DIR}/wheels/*.whl

-- 
To view, visit https://gerrit.wikimedia.org/r/301662
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib84e89114a07330c105876bcf7ee360135f5bcdd
Gerrit-PatchSet: 1
Gerrit-Project: labs/striker/deploy
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Thcipriani 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] labs...deploy[master]: Add scap3 check to create/update virtualenv

2016-07-28 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/301662

Change subject: Add scap3 check to create/update virtualenv
..

Add scap3 check to create/update virtualenv

(Ab)use the scap3 checks system to introduce a script that will ensure
that an up to date virtualenv is available during the promote stage of
each deployment. Modeled on similar usage in research/ores/deploy.git.

Change-Id: Ib84e89114a07330c105876bcf7ee360135f5bcdd
---
A scap/checks.yaml
A scap/checks/virtualenv.sh
2 files changed, 28 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/striker/deploy 
refs/changes/62/301662/1

diff --git a/scap/checks.yaml b/scap/checks.yaml
new file mode 100644
index 000..21ac7c7
--- /dev/null
+++ b/scap/checks.yaml
@@ -0,0 +1,8 @@
+---
+checks:
+  virtualenv:
+type: command
+stage: promote
+timeout: 300
+group: default
+command: bash /srv/deployment/striker/deploy/scap/checks/virtualenv.sh
diff --git a/scap/checks/virtualenv.sh b/scap/checks/virtualenv.sh
new file mode 100755
index 000..2778a57
--- /dev/null
+++ b/scap/checks/virtualenv.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+# Create/update a python virtualenv using the wheel binaries
+set -o errexit
+set -o nounset
+set -o pipefail
+
+VENV=/srv/deployment/striker/venv
+DEPLOY_DIR=/srv/deployment/striker/deploy
+
+PIP=${VENV}/bin/pip
+
+# Ensure that the virtual environment exists
+mkdir -p $VENV
+virtualenv --python python3 --system-site-packages $VENV
+
+# Remove all existing packages from the venv
+$PIP freeze | xargs $PIP uninstall -y
+
+# Install all of the packaged wheels
+$PIP install --use-wheel --no-deps ${DEPLOY_DIR}/wheels/*.whl

-- 
To view, visit https://gerrit.wikimedia.org/r/301662
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib84e89114a07330c105876bcf7ee360135f5bcdd
Gerrit-PatchSet: 1
Gerrit-Project: labs/striker/deploy
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits