Skip to content

Commit

Permalink
More "bones" work,
Browse files Browse the repository at this point in the history
connect the dots between the ci run's bash scripts,
and a nodejs script to actually popluate the inital_data
of the cc_app.
  • Loading branch information
wayneseymour committed Feb 5, 2020
1 parent aacafb7 commit c633304
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .ci/Jenkinsfile_coverage
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
set -e
# Check whether NodeJS works here
node -e 'console.log("### NodeJS works!")'
. src/dev/code_coverage/shell_scripts/extract_archives.sh
. src/dev/code_coverage/shell_scripts/extract_xpack_tests.sh
Expand All @@ -83,11 +80,13 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
. src/dev/code_coverage/shell_scripts/ingest_coverage.sh ${BUILD_NUMBER}
. src/dev/code_coverage/shell_scripts/bootstrap_app_initial_data.sh ${BUILD_NUMBER}
. src/dev/code_coverage/shell_scripts/query_app_initial_data.sh ${BUILD_NUMBER}
# Check my work :)
cat src/dev/code_coverage/shell_scripts/bootstrapped.txt
node src/dev/code_coverage/node_scripts/cc_app_bootstrap/index.js ${BUILD_NUMBER}
""",
"### Run `yarn kbn bootstrap && merge coverage` and Ingest Code Coverage to ES Cluster"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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 { createFlagError, run } from '@kbn/dev-utils';
import { resolve } from "path";

const about = 'Populate the initial data for the code coverage static site.';

export function populate(buildNumber) {
console.log(`\n### buildNumber: \n\t${buildNumber}`);

run(
({ log }) => {
log.info(`### ${about}`);
// Grab the data file
// Parse it
// Populate cc_app/public/inital_data.js

},
{
description: `
${about}
`,
}
);
}
5 changes: 5 additions & 0 deletions src/dev/code_coverage/node_scripts/cc_app_bootstrap/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require('../../../../../src/setup_node_env');

const buildNumber = process.argv[2];

require('./bootstrap_app_initial_data').populate(buildNumber);

0 comments on commit c633304

Please sign in to comment.