Skip to content

Commit

Permalink
Added Jenkins config
Browse files Browse the repository at this point in the history
Added Jenkins and deployment package configuration
SNOW-494
  • Loading branch information
mikegron committed Jan 7, 2021
1 parent 0dfb39a commit 5f58796
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .deployment.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"team_name": "searchuiextensions",
"product": "search-ui-extensions-cdn",
"general": {
"environments_order": {
"sequential": [
"dev",
"qa",
"prd"
]
},
"start_environment_automatically": true
},
"snyk": {
"org": "coveo-jsui",
"no_container_images": true
},
"observatory": {
"no_endpoint": true
},
"veracode": {
"no_scan": true
},
"phases": {
"s3": {
"dev": {
"bucket": "coveo-ndev-binaries"
},
"qa": {
"bucket": "coveo-nqa-binaries"
},
"prd": {
"bucket": "coveo-nprod-binaries"
},
"directory": "proda/StaticCDN",
"parameters": {
"acl": "public-read"
}
}
},
"deployment_config_version": 1
}
64 changes: 64 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
library(
identifier: "jenkins-common-lib@v1.4",
retriever: modernSCM(github(credentialsId: "github-app-dev", repository: "jenkins-common-lib", repoOwner: "coveo")),
changelog: false
)

pipeline {
agent {
label "linux && docker"
}
options {
timestamps()
ansiColor("xterm")
buildDiscarder(logRotator(numToKeepStr: "30"))
timeout(time: 1, unit: "HOURS")
}
environment {
NODE_IMAGE = "node:lts"
DEPLOY_PIPELINE_IMAGE = '458176070654.dkr.ecr.us-east-1.amazonaws.com/jenkins/deployment_package:v7'
}

stages {
stage("Setup") {
steps {
withDockerContainer(image: NODE_IMAGE, args: "-u root:root") {
sh "npm install"
sh "npm run lint"
sh "npm run testCoverage"
sh "npm run dev & npx wait-on http://localhost:8080"
sh "npx cypress run"
}
}
}

stage("Test package") {
steps {
withDockerContainer(image: NODE_IMAGE, args: "-u root:root") {
sh "node ./scripts/before.deploy.js"
}

withCredentials([string(credentialsId: 'snyk_token', variable: 'SNYK_TOKEN')]) {
runSnyk(org: "coveo-jsui", directory: ".")
}

withDockerContainer(image: DEPLOY_PIPELINE_IMAGE) {
sh "deployment-package package create --version ${params.NPM_PACKAGE_VERSION} --dry-run"
}
}
}
/*
stage("Deploy") {
steps {
withDockerContainer(image: DEPLOY_PIPELINE_IMAGE) {
script {
packageName = sh (script: "deployment-package package create --version ${params.NPM_PACKAGE_VERSION}", returnStdout: true).trim()
sh "deployment-package package deploy --package-name ${packageName} --target-environment dev"
}
}
}
}
*/
}
}

0 comments on commit 5f58796

Please sign in to comment.