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

Changed from 'npm install' to 'yarn' in Jenkinsfile. Also minor changes. #83

Merged
merged 1 commit into from May 28, 2018
Merged
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -1,10 +1,9 @@
FROM node:8

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

RUN curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.6.0
export PATH=$HOME/.yarn/bin:$PATH
RUN npm install -g yarn

ARG UID
ARG GID
@@ -14,4 +13,4 @@ RUN groupadd jenkins -g $GID \
USER jenkins
COPY package.json /home/jenkins/
COPY yarn.lock /home/jenkins/
RUN cd /home/jenkins/ && yarn install
RUN cd /home/jenkins/ && yarn install --frozen-lockfile
@@ -12,7 +12,7 @@ node('docker') {

def img
def artifacts = []
def uploadPath = "cdncliqz/update/ghostery/${env.BRANCH_NAME}"
def uploadPath = "cdncliqz/update/ghostery/android"

stage('Build Docker Image') {
img = docker.build('ghostery/build', '--build-arg UID=`id -u` --build-arg GID=`id -g` .')
@@ -23,71 +23,31 @@ node('docker') {
stage('Build Extension') {
img.inside() {
withCache {
sh 'rm -rf build'
if (params.WITH_CLIQZ_MASTER) {
sh 'npm install --save https://s3.amazonaws.com/cdncliqz/update/edge/ghostery/master/latest.tgz'
}
// make browser-core noisy
sh 'sed -i \'s/global.__DEV__/true/1\' node_modules/browser-core/build/core/console.js'
withGithubCredentials {
sh 'moab makezip'
withEnv(["NO_LINT=true"]) {

This comment has been minimized.

@luciancor

luciancor May 28, 2018
Contributor

@christophertino is this step always required?
Will merge this PR to keep the train moving but we probably need to double check this again before merging back to your branches (this and probably many more :) )

sh 'rm -rf build'
if (params.WITH_CLIQZ_MASTER) {
sh 'yarn add https://s3.amazonaws.com/cdncliqz/update/edge/ghostery/master/latest.tgz'
}
// make browser-core noisy
sh 'sed -i \'s/global.__DEV__/true/1\' node_modules/browser-core/build/core/console.js'
withGithubCredentials {
sh 'moab makezip'
}
// get the name of the firefox build
artifacts.add(sh(returnStdout: true, script: 'ls build/ | grep firefox').trim())
}
// get the name of the firefox build
artifacts.add(sh(returnStdout: true, script: 'ls build/ | grep firefox').trim())
}
}
}

if (env.BRANCH_NAME != 'android_browser') {
stage('Package Chrome') {
withGithubCredentials {
def chromeArtifact = sh(returnStdout: true, script: 'ls build/ | grep chrome').trim().replace('.zip', '')
echo "${chromeArtifact}"
sh """#!/bin/bash -l
set -x
set -e
rm -rf ${chromeArtifact}/
mkdir -p ${chromeArtifact}
unzip build/${chromeArtifact}.zip -d ${chromeArtifact}
tools/crxmake.sh ${chromeArtifact}/ ~/.ssh/id_rsa
mv ${chromeArtifact}.crx build/
"""
artifacts.add("${chromeArtifact}.crx")
}
}
}

stage('Upload Builds') {
withS3Credentials {
echo "${env.BRANCH_NAME}/${env.BUILD_NUMBER}"
def uploadLocation = "s3://${uploadPath}/"
def uploadLocation = "s3://${uploadPath}"
currentBuild.description = uploadLocation
artifacts.each {
sh "aws s3 cp build/${it} ${uploadLocation} --acl public-read"
}
}
}

if (env.BRANCH_NAME == 'develop') {
stage('Publish Beta') {
artifacts.each {
if (it.contains('firefox')) {
// firefox artifact (zip) - sign for cliqz_beta
def artifactUrl = "https://s3.amazonaws.com/${uploadPath}/${it}"
build job: 'addon-repack', parameters: [
string(name: 'XPI_URL', value: artifactUrl),
string(name: 'XPI_SIGN_CREDENTIALS', value: '41572f9c-06aa-46f0-9c3b-b7f4f78e9caa'),
string(name: 'XPI_SIGN_REPO_URL', value: 'git@github.com:cliqz/xpi-sign.git'),
string(name: 'CHANNEL', value: 'browser_beta')
]
} else if (it.contains('chrome')) {
withS3Credentials {
// publish chrome builds, also with 'latest' tag
def publishUrl = 's3://cdncliqz/update/ghostery_beta/chrome';
sh "aws s3 cp build/${it} ${publishUrl}/${it} --acl public-read"
sh "aws s3 cp build/${it} ${publishUrl}/latest.crx --acl public-read"
}
}
sh "aws s3 cp build/${it} ${uploadLocation}/${env.BRANCH_NAME}/ --acl public-read"
sh "aws s3 cp build/${it} ${uploadLocation}/latest.zip --acl public-read"
}
}
}
ProTip! Use n and p to navigate between commits in a pull request.