Hashar has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/386053 )
Change subject: castor in a container
......................................................................
castor in a container
Poor animal :o(
Change-Id: I44d188430cbd8a9c6528ab0fba8bce560870ced9
---
A dockerfiles/castor/Dockerfile
A dockerfiles/castor/example-run.sh
A dockerfiles/castor/prebuild.sh
A dockerfiles/castor/run.bash
M jjb/castor.yaml
5 files changed, 78 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/integration/config
refs/changes/53/386053/1
diff --git a/dockerfiles/castor/Dockerfile b/dockerfiles/castor/Dockerfile
new file mode 100644
index 0000000..a436629
--- /dev/null
+++ b/dockerfiles/castor/Dockerfile
@@ -0,0 +1,13 @@
+FROM docker-registry.wikimedia.org/wikimedia-stretch:latest
+
+RUN apt-get update \
+ && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
+ openssh-client \
+ rsync \
+ && rm -rf /var/lib/apt/lists/*
+
+COPY src/ /castor
+COPY run.bash /run.bash
+
+USER nobody
+ENTRYPOINT ["/run.bash"]
diff --git a/dockerfiles/castor/example-run.sh
b/dockerfiles/castor/example-run.sh
new file mode 100755
index 0000000..3b5775c
--- /dev/null
+++ b/dockerfiles/castor/example-run.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+set -e
+
+function assert() {
+ expected=$1
+ shift
+
+ exec 3>&1
+ actual=$("$@"|tee >(cat - >&3))
+
+ if [ "$expected" = "$actual" ]; then
+ echo "[OK] $expected"
+ else
+ echo "[FAILED] $expected"
+ colordiff -u <(echo "$expected") <(echo "$actual")
+ fi
+}
+
+assert $'Defined: CASTOR_NAMESPACE="mediawiki-core/master/dosomething"\r'
docker run \
+ --rm --tty \
+ --env ZUUL_PROJECT=mediawiki/core \
+ --env ZUUL_BRANCH=master \
+ --env JOB_NAME=dosomething \
+ wmfreleng/castor:latest \
+ config
diff --git a/dockerfiles/castor/prebuild.sh b/dockerfiles/castor/prebuild.sh
new file mode 100755
index 0000000..badc5c8
--- /dev/null
+++ b/dockerfiles/castor/prebuild.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+set -e
+
+mkdir -p "$(dirname "$0")"/src
+cp -vf "$(dirname "$0")"/../../jjb/castor*.bash "$(dirname "$0")"/src
diff --git a/dockerfiles/castor/run.bash b/dockerfiles/castor/run.bash
new file mode 100755
index 0000000..c9c26bd
--- /dev/null
+++ b/dockerfiles/castor/run.bash
@@ -0,0 +1,23 @@
+#!/bin/bash
+set -e
+
+case ${1:-missing} in
+ config)
+ source castor/castor-define-namespace.bash
+ ;;
+ save)
+ source castor/castor-define-namespace.bash
+ source castor/castor-save-sync.bash
+ ;;
+ load)
+ source castor/castor-define-namespace.bash
+ source castor/castor-load-sync.bash
+ ;;
+ *)
+ echo "USAGE:"
+ echo " castor config"
+ echo " castor save"
+ echo " castor load"
+ exit 1
+ ;;
+esac
diff --git a/jjb/castor.yaml b/jjb/castor.yaml
index c1ed0fb..ca98a79 100644
--- a/jjb/castor.yaml
+++ b/jjb/castor.yaml
@@ -46,6 +46,16 @@
- castor-define-namespace.bash
- castor-load-sync.bash
+- builder:
+ name: docker-castor-load
+ builders:
+ - shell: |
+ /usr/bin/env > .env
+ docker run -rm --tty
+ --env-file .env \
+ --volume "$(WORKSPACE)/cache":/cache \
+ wmfreleng/castor:latest \
+ load
# Job triggered on the central repository instance
#
--
To view, visit https://gerrit.wikimedia.org/r/386053
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I44d188430cbd8a9c6528ab0fba8bce560870ced9
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits