[build] Remove grunt docker:docs task (#85848)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
27b3a366a3
commit
26b784b2a4
|
@ -1,53 +0,0 @@
|
||||||
/*
|
|
||||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
|
||||||
* license agreements. See the NOTICE file distributed with
|
|
||||||
* this work for additional information regarding copyright
|
|
||||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
|
||||||
* the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
* not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import del from 'del';
|
|
||||||
import { join } from 'path';
|
|
||||||
import { execFileSync as exec } from 'child_process';
|
|
||||||
|
|
||||||
export default function (grunt) {
|
|
||||||
grunt.registerTask('docker:docs', 'Build docs from docker', function () {
|
|
||||||
const rootPath = grunt.config.get('root');
|
|
||||||
const composePath = join(rootPath, 'tasks/docker_docs/docker-compose.yml');
|
|
||||||
const htmlDocsDir = join(rootPath, 'html_docs');
|
|
||||||
|
|
||||||
const env = Object.assign(process.env, {
|
|
||||||
KIBANA_DOCS_CONTAINER_NAME: 'kibana_docs',
|
|
||||||
KIBANA_DOCS_CONTEXT: rootPath,
|
|
||||||
});
|
|
||||||
const stdio = [0, 1, 2];
|
|
||||||
const execOptions = { env, stdio };
|
|
||||||
|
|
||||||
exec('docker-compose', ['-f', composePath, 'up'], execOptions);
|
|
||||||
|
|
||||||
const containerId = String(
|
|
||||||
exec('docker-compose', ['-f', composePath, 'ps', '-q', env.KIBANA_DOCS_CONTAINER_NAME], {
|
|
||||||
env,
|
|
||||||
})
|
|
||||||
).trim();
|
|
||||||
|
|
||||||
grunt.log.write('Clearing old docs ... ');
|
|
||||||
del.sync(htmlDocsDir);
|
|
||||||
grunt.log.writeln('done');
|
|
||||||
|
|
||||||
grunt.log.write('Copying new docs ... ');
|
|
||||||
exec('docker', ['cp', `${containerId}:/home/kibana/html_docs`, htmlDocsDir]);
|
|
||||||
grunt.log.writeln('done');
|
|
||||||
});
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
FROM alpine:3.6
|
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
|
||||||
git \
|
|
||||||
libxslt \
|
|
||||||
curl \
|
|
||||||
python \
|
|
||||||
libxml2-utils \
|
|
||||||
perl
|
|
||||||
|
|
||||||
RUN addgroup kibana && \
|
|
||||||
adduser -D -G kibana -s /bin/bash -h /home/kibana kibana
|
|
||||||
|
|
||||||
USER kibana
|
|
||||||
RUN git clone --depth 1 https://github.com/elastic/docs.git /home/kibana/docs_builder
|
|
||||||
|
|
||||||
WORKDIR /home/kibana/docs_builder
|
|
||||||
CMD git pull origin master && ./build_docs.pl --doc /home/kibana/ascii_docs/index.asciidoc --out /home/kibana/html_docs --chunk=1
|
|
|
@ -1,8 +0,0 @@
|
||||||
version: '2'
|
|
||||||
services:
|
|
||||||
kibana_docs:
|
|
||||||
container_name: $KIBANA_DOCS_CONTAINER_NAME
|
|
||||||
build:
|
|
||||||
context: $KIBANA_DOCS_CONTEXT/tasks/docker_docs
|
|
||||||
volumes:
|
|
||||||
- $KIBANA_DOCS_CONTEXT/docs:/home/kibana/ascii_docs
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
source "$(dirname $0)/../../src/dev/ci_setup/setup.sh"
|
|
||||||
|
|
||||||
"$(FORCE_COLOR=0 yarn bin)/grunt" docker:docs;
|
|
Loading…
Reference in a new issue