Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated extension builds #32

Merged
merged 12 commits into from Apr 10, 2018
Next

WIP nightly builds on jenkins

  • Loading branch information
sammacbeth committed Apr 5, 2018
commit 82d8b4b9a040895c400070de0091ada0293ea53a
@@ -0,0 +1,12 @@
FROM node:6.14.1

RUN npm install -g web-ext

ARG UID
ARG GID
RUN groupadd jenkins -g $GID \
&& useradd -ms /bin/bash jenkins -u $UID -g $GID

USER jenkins
COPY package.json /home/jenkins/
RUN cd /home/jenkins/ && npm install
@@ -0,0 +1,48 @@
node('docker') {
stage ('Checkout') {
checkout scm
}

def img

stage('Build Docker Image') {
img = docker.build('ghostery/build', '--build-arg UID=`id -u` --build-arg GID=`id -g` .')
}

stage('Build Extension') {
img.inside() {
withCache {
// rerun postinstall for vendor-copy
sh 'npm run postinstall'
sh 'npm run build.prod'
sh 'web-ext build --overwrite-dest'
}
}
}

stage('Publish') {
withCredentials([[
$class: 'UsernamePasswordMultiBinding',
credentialsId: '06ec4a34-9d01-46df-9ff8-64c79eda8b14',
passwordVariable: 'AWS_SECRET_ACCESS_KEY',
usernameVariable: 'AWS_ACCESS_KEY_ID']]) {
sh 'aws s3 sync web-ext-artifacts/ s3://cdncliqz/update/ghostery/nightly_test/ --acl public-read'
}
}
}

def withCache(Closure body=null) {
def cleanCache = {
sh 'rm -fr node_modules'
}

try {
cleanCache()
// Main dependencies
sh 'cp -fr /home/jenkins/node_modules .'

body()
} finally {
cleanCache()
}
}
ProTip! Use n and p to navigate between commits in a pull request.