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

Add option to build with browser-core master

  • Loading branch information
sammacbeth committed Apr 6, 2018
commit 6db0d29b4b8fcd04198928a8698ef0f7ce311156
@@ -1,7 +1,7 @@
FROM node:6.14.1
FROM node:8

#RUN npm install -g web-ext
RUN curl https://s3.amazonaws.com/cdncliqz/update/ghostery/moab/moab_3 > /bin/moab && \
RUN curl https://s3.amazonaws.com/cdncliqz/update/ghostery/moab/moab_2 > /bin/moab && \
chmod +x /bin/moab

ARG UID
@@ -1,3 +1,10 @@

properties([
parameters([
booleanParam(name: 'WITH_CLIQZ_MASTER', defaultValue: false, description: 'Builds with latest Cliqz master')
])
])

node('docker') {
stage ('Checkout') {
checkout scm
@@ -11,42 +18,45 @@ node('docker') {
}

stage('Build Extension') {
img.inside() {
withCache {
sh 'rm -r build/'
sh 'moab makezip'
// get the name of the firefox build
artifact = sh(returnStdout: true, script: 'ls build/ | grep firefox').trim()
img.inside() {
withCache {
sh 'rm -r build'
if (params.WITH_CLIQZ_MASTER) {
sh 'npm install --save https://s3.amazonaws.com/cdncliqz/update/edge/ghostery/master/latest.tgz'
}
sh 'moab makezip'
// get the name of the firefox build
artifact = sh(returnStdout: true, script: 'ls build/ | grep firefox').trim()
}
}
}
}

stage('Publish') {
withCredentials([[
$class: 'UsernamePasswordMultiBinding',
credentialsId: '06ec4a34-9d01-46df-9ff8-64c79eda8b14',
passwordVariable: 'AWS_SECRET_ACCESS_KEY',
usernameVariable: 'AWS_ACCESS_KEY_ID']]) {
echo "${env.BRANCH_NAME}/${env.BUILD_NUMBER}"
def uploadLocation = "s3://cdncliqz/update/ghostery/nightly_test/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/${artifact}"
currentBuild.description = uploadLocation
sh "aws s3 cp build/${artifact} ${uploadLocation} --acl public-read"
}
withCredentials([[
$class: 'UsernamePasswordMultiBinding',
credentialsId: '06ec4a34-9d01-46df-9ff8-64c79eda8b14',
passwordVariable: 'AWS_SECRET_ACCESS_KEY',
usernameVariable: 'AWS_ACCESS_KEY_ID']]) {
echo "${env.BRANCH_NAME}/${env.BUILD_NUMBER}"
def uploadLocation = "s3://cdncliqz/update/ghostery/nightly_test/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/${artifact}"
currentBuild.description = uploadLocation
sh "aws s3 cp build/${artifact} ${uploadLocation} --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()
}
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.