From 9c04bedeca546fb5d4f5b0d4a6128da93b1f977c Mon Sep 17 00:00:00 2001 From: Bishoy Boktor Date: Wed, 3 Feb 2021 23:38:32 +0000 Subject: [PATCH] [PURIFY] Removes newsfeed plugin from appearing in UI and making network requests (#10) --- Dockerfile | 33 ++++++++++++++++++ Jenkinsfile | 46 +++++++++++++++---------- src/plugins/kibana_overview/kibana.json | 3 +- src/plugins/newsfeed/kibana.json | 2 +- 4 files changed, 63 insertions(+), 21 deletions(-) create mode 100755 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100755 index 000000000000..534b98ef7de4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +ARG NODE_VERSION=10.23.1 +FROM node:${NODE_VERSION} AS base + +ENV HOME '.' +RUN apt-get update && \ + apt-get -y install xvfb gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 \ + libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 \ + libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 \ + libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 \ + libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget openjdk-8-jre && \ + rm -rf /var/lib/apt/lists/* + +RUN curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \ + && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ + && apt-get update \ + && apt-get install -y rsync jq bsdtar google-chrome-stable \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN LATEST_VAULT_RELEASE=$(curl -s https://api.github.com/repos/hashicorp/vault/tags | jq --raw-output .[0].name[1:]) \ + && curl -L https://releases.hashicorp.com/vault/${LATEST_VAULT_RELEASE}/vault_${LATEST_VAULT_RELEASE}_linux_amd64.zip -o vault.zip \ + && unzip vault.zip \ + && rm vault.zip \ + && chmod +x vault \ + && mv vault /usr/local/bin/vault + +RUN apt-get update && apt-get install -y \ + python-pip +RUN pip install awscli + +RUN groupadd -r kibana && useradd -r -g kibana kibana && mkdir /home/kibana && chown kibana:kibana /home/kibana + +USER kibana diff --git a/Jenkinsfile b/Jenkinsfile index 3b68cde20657..5dff2eb8ef6c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,21 +1,31 @@ -#!/bin/groovy - -library 'kibana-pipeline-library' -kibanaLibrary.load() - -kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true, setCommitStatus: true) { - slackNotifications.onFailure(disabled: !params.NOTIFY_ON_FAILURE) { - githubPr.withDefaultPrComments { - ciStats.trackBuild { - catchError { - retryable.enable() - kibanaPipeline.allCiTasks() +node { + label 'website' + def scmVars = checkout scm + sh "env" + def imageName = "test-image:${env.BUILD_ID}" + def testImage + stage('Build container image') { + sh 'ls -l' + testImage = docker.build imageName + } + testImage.inside { + try { + stage('bootstrap') { + sh 'yarn kbn bootstrap' + } + stage('unit tests') { + sh 'yarn test:jest -u --ci --verbose --maxWorkers=5' + } + stage('integration tests') { + sh 'yarn test:jest_integration -u --ci' + sh 'yarn test:mocha' + } + } catch (e) { + echo 'This will run only if failed' + currentBuild.result = 'FAILURE' + // Since we're catching the exception in order to report on it, + // we need to re-throw it, to ensure that the build is marked as failed + throw e } - } } - } - - if (params.NOTIFY_ON_FAILURE) { - kibanaPipeline.sendMail() - } } diff --git a/src/plugins/kibana_overview/kibana.json b/src/plugins/kibana_overview/kibana.json index 9ddcaabdaed6..07d45d916e3d 100644 --- a/src/plugins/kibana_overview/kibana.json +++ b/src/plugins/kibana_overview/kibana.json @@ -4,6 +4,5 @@ "server": false, "ui": true, "requiredPlugins": ["navigation", "data", "home"], - "optionalPlugins": ["newsfeed"], - "requiredBundles": ["kibanaReact", "newsfeed"] + "requiredBundles": ["kibanaReact"] } diff --git a/src/plugins/newsfeed/kibana.json b/src/plugins/newsfeed/kibana.json index b9f37b67f692..501c658df962 100644 --- a/src/plugins/newsfeed/kibana.json +++ b/src/plugins/newsfeed/kibana.json @@ -2,5 +2,5 @@ "id": "newsfeed", "version": "kibana", "server": true, - "ui": true + "ui": false }