Skip to content

Commit

Permalink
build(jenkins): add air fresheners on build (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-bompart committed Jan 26, 2022
1 parent 3611f9b commit 5cf8560
Show file tree
Hide file tree
Showing 5 changed files with 16,967 additions and 8,240 deletions.
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ node_modules/**/*
.travis.yml
LICENSE
Jenkinsfile
.deployment.config
.deployment.config
.cache/**/*
22 changes: 18 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
library(
identifier: "jenkins-common-lib@v1.6",
identifier: "jenkins-common-lib@master",
retriever: modernSCM(github(credentialsId: "github-app-dev", repository: "jenkins-common-lib", repoOwner: "coveo")),
changelog: false
)
Expand All @@ -17,13 +17,19 @@ pipeline {
environment {
NODE_IMAGE = "node:lts"
DEPLOY_PIPELINE_IMAGE = '458176070654.dkr.ecr.us-east-1.amazonaws.com/jenkins/deployment_package:v7'
CYPRESS_CACHE_FOLDER = "${WORKSPACE}/.cache/cypress"
NPM_CONFIG_CACHE = "${WORKSPACE}/.cache/npm"
HOME = "${WORKSPACE}"
}

stages {
stage("Build and Test") {
steps {
withDockerContainer(image: NODE_IMAGE, args: "-u root:root") {
withCredentials([string(credentialsId: 'coveralls-search-ui-extensions', variable: 'COVERALLS_REPO_TOKEN')]) {
sh "mkdir -p .cache/cypress"
sh "mkdir -p .cache/.npm"
sh "chmod -R 777 .cache"
sh "apt-get update -qq"
sh "apt install -qq -y 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"
sh "npm install"
Expand All @@ -37,8 +43,10 @@ pipeline {

stage("Snyk") {
steps {
withCredentials([string(credentialsId: 'snyk_token', variable: 'SNYK_TOKEN')]) {
runSnyk(org: "coveo-jsui", directory: ".")
withDockerContainer(image: NODE_IMAGE, args: "-u root:root") {
withCredentials([string(credentialsId: 'snyk_token', variable: 'SNYK_TOKEN')]) {
sh "npx snyk test --org=coveo-jsui"
}
}
}
}
Expand All @@ -60,4 +68,10 @@ pipeline {
}
}
}
}

post {
always {
cleanWs()
}
}
}
Loading

0 comments on commit 5cf8560

Please sign in to comment.