Skip to content

Commit

Permalink
Merge branch 'branches/rudder/6.2' into branches/rudder/7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amousset committed Nov 18, 2021
2 parents 2fdc1a0 + e297d31 commit ead2df4
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 20 deletions.
62 changes: 42 additions & 20 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,40 @@ pipeline {
}
}
}
stage('typos') {
agent {
dockerfile {
filename 'ci/typos.Dockerfile'
additionalBuildArgs '--build-arg VERSION=1.0'
}
}
steps {
dir('language') {
sh script: 'typos', label: 'check language typos'
}
dir('webapp/sources/api-doc') {
sh script: 'typos', label: 'check webapp api doc typos'
}
dir('relay/sources/') {
sh script: 'typos --exclude "*.pem"', label: 'check relayd typos'
}
}
post {
always {
script {
new SlackNotifier().notifyResult("shell-team")
}
}
}
}
stage('api-doc') {
agent { label 'api-docs' }
agent {
dockerfile {
filename 'api-doc/Dockerfile'
// To get the jenkins user inside of the container
args '-v /etc/passwd:/etc/passwd:ro'
}
}

stages {
stage('api-doc-test') {
Expand All @@ -54,12 +86,6 @@ pipeline {
}
}
steps {
dir('webapp/sources/api-doc') {
sh script: 'typos', label: 'check typos'
}
dir('relay/sources/api-doc') {
sh script: 'typos', label: 'check typos'
}
dir('api-doc') {
sh script: 'make', label: 'build API docs'
}
Expand All @@ -82,17 +108,11 @@ pipeline {
}
}
steps {
dir('webapp/sources/api-doc') {
sh script: 'typos', label: 'check typos'
}
dir('relay/sources/api-doc') {
sh script: 'typos', label: 'check typos'
}
dir('api-doc') {
sh script: 'make', label: 'build API docs'
withCredentials([sshUserPrivateKey(credentialsId: 'f15029d3-ef1d-4642-be7d-362bf7141e63', keyFileVariable: 'KEY_FILE', passphraseVariable: '', usernameVariable: 'KEY_USER')]) {
sh script: 'rsync -avz -e "ssh -i${KEY_FILE} -p${SSH_PORT}" target/webapp/* ${KEY_USER}@${HOST_DOCS}:/var/www-docs/api/v/', label: 'publish webapp API docs'
sh script: 'rsync -avz -e "ssh -i${KEY_FILE} -p${SSH_PORT}" target/relay/* ${KEY_USER}@${HOST_DOCS}:/var/www-docs/api/relay/v/', label: 'publish relay API docs'
sh script: 'rsync -avz -e "ssh -o StrictHostKeyChecking=no -i${KEY_FILE} -p${SSH_PORT}" target/webapp/* ${KEY_USER}@${HOST_DOCS}:/var/www-docs/api/v/', label: 'publish webapp API docs'
sh script: 'rsync -avz -e "ssh -o StrictHostKeyChecking=no -i${KEY_FILE} -p${SSH_PORT}" target/relay/* ${KEY_USER}@${HOST_DOCS}:/var/www-docs/api/relay/v/', label: 'publish relay API docs'
}
}
}
Expand All @@ -109,10 +129,15 @@ pipeline {
}
}
stage('rudder-pkg') {
agent { label 'script' }
agent {
dockerfile {
filename 'relay/sources/rudder-pkg/Dockerfile'
args '-v /etc/passwd:/etc/passwd:ro --tmpfs /srv/jenkins/.local:exec'
}
}

steps {
dir ('relay/sources') {
sh script: 'typos --exclude "api-doc/*" --exclude "relayd/*"', label: 'check typos'
sh script: 'make check', label: 'rudder-pkg tests'
}
}
Expand Down Expand Up @@ -245,7 +270,6 @@ pipeline {
credentialsId: '17ec2097-d10e-4db5-b727-91a80832d99d'
}
}
sh script: 'typos', label: 'check typos'
sh script: 'make check', label: 'language tests'
sh script: 'make docs', label: 'language docs'
sh script: 'make clean', label: 'relayd clean'
Expand Down Expand Up @@ -279,7 +303,6 @@ pipeline {
credentialsId: '17ec2097-d10e-4db5-b727-91a80832d99d'
}
}
sh script: 'typos', label: 'check typos'
sh script: 'make check', label: 'language tests'
sh script: 'make docs', label: 'language docs'
withCredentials([sshUserPrivateKey(credentialsId: 'f15029d3-ef1d-4642-be7d-362bf7141e63', keyFileVariable: 'KEY_FILE', passphraseVariable: '', usernameVariable: 'KEY_USER')]) {
Expand Down Expand Up @@ -307,7 +330,6 @@ pipeline {
steps {
// System dependencies: libpq-dev postgresql
dir('relay/sources/relayd') {
sh script: 'typos --exclude "*.pem"', label: 'check typos'
// lock the database to avoid race conditions between parallel tests
lock('test-relayd-postgresql') {
sh script: 'make check', label: 'relayd tests'
Expand Down
1 change: 1 addition & 0 deletions api-doc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/build
/target
node_modules
5 changes: 5 additions & 0 deletions api-doc/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM node:16-bullseye
ENV NODE_ENV=production

RUN npm install --global @redocly/[email protected] [email protected]
RUN apt-get update && apt-get install -y rsync python3-yaml && rm -rf /var/lib/apt/lists/*
1 change: 1 addition & 0 deletions api-doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PyYAML
4 changes: 4 additions & 0 deletions ci/typos.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM rust
ARG VERSION

RUN cargo install -f typos-cli --version =$VERSION
4 changes: 4 additions & 0 deletions relay/sources/rudder-pkg/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM python

COPY relay/sources/rudder-pkg/requirements.txt requirements.txt
RUN pip install -r requirements.txt
5 changes: 5 additions & 0 deletions relay/sources/rudder-pkg/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blue==0.7.0
bandit==1.7.0
pylint==2.9.6
requests==2.26.0
hypothesis==6.24.6

0 comments on commit ead2df4

Please sign in to comment.