forked from couchbase/docs-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
53 lines (52 loc) · 1.57 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/env groovy
// Jenkins job configuration
// -------------------------
// Category: Multibranch Pipeline
// Pipeline name: docs-search-indexer
// Branch Sources: Single repository & branch
// Name: master
// Source Code Management: Git
// Repository URL: https://github.com/couchbase/docs-site
// Credentials: - none -
// Refspec: +refs/heads/master:refs/remotes/origin/master
// Branch specifier: refs/heads/master
// Advanced clone behaviors: [ ] Fetch tags, [x] Honor refspec on initial clone, [x] Shallow clone (depth: 3)
// Build Configuration:
// Mode: by Jenkinsfile
// Script Path: docsearch/Jenkinsfile
pipeline {
agent {
dockerfile {
dir 'docsearch'
filename 'Dockerfile.jenkins'
additionalBuildArgs '--build-arg GROUP_ID=$(id -g) --build-arg USER_ID=$(id -u)'
}
}
environment {
CONFIG="${env.WORKSPACE}/docsearch/docsearch-config.json"
HOME='/docsearch'
INDEX_NAME_TMP="$BUILD_TAG"
PIPENV_HIDE_EMOJIS=true
PIPENV_NOSPIN=true
UPDATE_NB_HITS=false
}
stages {
stage('Install') {
steps {
sh '(cd $HOME && pipenv install)'
}
}
stage('Generate Config') {
steps {
sh '(curl -sL https://docs.couchbase.com/site-manifest.json | npx -p hbs-cli -p glob@8 hbs -H "$PWD/docsearch/hbs-helpers/*.js" -i -s $CONFIG.hbs > $CONFIG)'
}
}
stage('Run') {
steps {
configFileProvider([configFile(fileId: 'algolia-application-credentials', targetLocation: '.env')]) {
sh '(mv .env $HOME/ && cd $HOME && pipenv run python -m src.index)'
}
}
}
}
}