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

Load github credentials to enable moab checkout of ghostery-libraries.

  • Loading branch information
sammacbeth committed Apr 10, 2018
commit 07a75692a44f60f0d86086dc364a36c1386ff889
@@ -1,6 +1,6 @@
FROM node:8

RUN curl https://s3.amazonaws.com/cdncliqz/update/ghostery/moab/moab_2 > /bin/moab && \
RUN curl https://s3.amazonaws.com/cdncliqz/update/ghostery/moab/moab_8319dab > /bin/moab && \
chmod +x /bin/moab

ARG UID
@@ -27,7 +27,9 @@ node('docker') {
}
// make browser-core noisy
sh 'sed -i \'s/global.__DEV__/true/1\' node_modules/browser-core/build/core/console.js'
sh 'moab makezip'
withGithubCredentials {
sh 'moab makezip'
}
// get the name of the firefox build
artifact = sh(returnStdout: true, script: 'ls build/ | grep firefox').trim()
}
@@ -72,3 +74,26 @@ def withCache(Closure body=null) {
cleanCache()
}
}

def withGithubCredentials(Closure body) {
withCredentials([sshUserPrivateKey(
credentialsId: '6739a36f-0b19-4f4d-b6e4-b01d0bc2e175',
keyFileVariable: 'GHOSTERY_CI_SSH_KEY')
]) {
// initialise git+ssh access using cliqz-ci credentials
try {
sh '''#!/bin/bash -l
set -x
set -e
mkdir -p ~/.ssh
cp $GHOSTERY_CI_SSH_KEY ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
'''
body()
} finally {
sh 'rm -f ~/.ssh/id_rsa'
sh 'rm -f ~/.ssh/known_hosts'
}
}
}
ProTip! Use n and p to navigate between commits in a pull request.