From 315df62758acb54c52f42bd3067a9ae95bcb3aa6 Mon Sep 17 00:00:00 2001 From: Brennen Bearnes Date: Tue, 14 May 2019 18:14:11 -0600 Subject: [PATCH] Add .pipeline/ with dev image variant This adds a .pipeline/, containing: - blubber.yaml which, for now, defines a single variant for creating a Docker image to be used by the local-charts[0] environment. This image is built on dev-stretch-php72-fpm-apache2, which is defined in dev-images[1]. - dev_prereq.sh which installs some extensions, runs composer, and creates a stub LocalSettings.php in the dev image as a blubber builder command. - config.yaml for building the dev image. This depends on publication of dev/stretch-php72-fpm-apache2 to docker-registry.wikimedia.org: - https://phabricator.wikimedia.org/T223327 - https://phabricator.wikimedia.org/T223329 It can be tested locally by: 1. Installing Docker, blubber[2], and Minikube 2. Building the images in dev-images with `make` 3. Saving a copy of the dev-stretch-php72-fpm-apache2 image: $ docker save -o dev-stretch-php72-fpm-apache2.tar docker-registry.wikimedia.org/dev/dev-stretch-php72-fpm-apache2 4. Importing that image into Minikube's docker: $ eval $(minikube docker-env) $ docker load --input ./dev-stretch-php72-fpm-apache2.tar 5. Building an image tagged "docker-registry.wikimedia.org/dev/mediawiki" from the root of this repository: $ blubber .pipeline/blubber.yaml dev | docker build --pull=false -t docker-registry.wikimedia.org/dev/mediawiki -f - . That image should now be usable by local-charts. [0]. https://gerrit.wikimedia.org/r/plugins/gitiles/releng/local-charts/ [1]. https://gerrit.wikimedia.org/r/plugins/gitiles/releng/dev-images/ [2]. https://wikitech.wikimedia.org/wiki/Blubber/Download Bug: T218360 Change-Id: I1c8192e67c39e86c4903a9137dba7c02faee3145 Depends-On: I8a5a5f2c24d81fb94b104a3a98627d9fbe6059bf --- .pipeline/blubber.yaml | 14 ++++++++++++++ .pipeline/config.yaml | 9 +++++++++ .pipeline/dev_prereq.sh | 16 ++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 .pipeline/blubber.yaml create mode 100644 .pipeline/config.yaml create mode 100755 .pipeline/dev_prereq.sh diff --git a/.pipeline/blubber.yaml b/.pipeline/blubber.yaml new file mode 100644 index 0000000000..13ad966774 --- /dev/null +++ b/.pipeline/blubber.yaml @@ -0,0 +1,14 @@ +version: v4 +base: docker-registry.wikimedia.org/dev/stretch-php72-fpm-apache2 + +lives: + in: /var/www/html + +variants: + dev: + runs: + insecurely: true + builder: + command: [.pipeline/dev_prereq.sh] + requirements: [.pipeline, .pipeline/dev_prereq.sh, composer.json] + copies: [local] diff --git a/.pipeline/config.yaml b/.pipeline/config.yaml new file mode 100644 index 0000000000..08f1db86e4 --- /dev/null +++ b/.pipeline/config.yaml @@ -0,0 +1,9 @@ +pipelines: + publish: + blubberfile: blubber.yaml + stages: + - name: dev + build: dev + publish: + image: true + tags: [dev] diff --git a/.pipeline/dev_prereq.sh b/.pipeline/dev_prereq.sh new file mode 100755 index 0000000000..a1f4bd0160 --- /dev/null +++ b/.pipeline/dev_prereq.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +mkdir /tmp/php +mkdir -p extensions + +git clone --depth 1 https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor.git /var/www/html/extensions/VisualEditor +git clone --depth 1 https://gerrit.wikimedia.org/r/mediawiki/skins/Vector /var/www/html/skins/Vector +cd /var/www/html/extensions/VisualEditor +git submodule update --depth 1 --init + +cd /var/www/html +composer install +cat < LocalSettings.php +