Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
Update build scripts to use Concourse
Browse files Browse the repository at this point in the history
  • Loading branch information
suda committed Aug 10, 2017
1 parent 9d19964 commit cc0fba2
Show file tree
Hide file tree
Showing 10 changed files with 304 additions and 198 deletions.
55 changes: 0 additions & 55 deletions .travis.yml

This file was deleted.

274 changes: 137 additions & 137 deletions build/resources/particle-code-signing-cert.p12.enc

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/tasks/get-particle-dev-version.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ getParticleDevVersion = (cb) ->
# Get Particle Dev version from options/current sources
if !!_grunt.option('particleDevVersion')
cb _grunt.option('particleDevVersion')
else if (!!process.env.TRAVIS_TAG or !!process.env.APPVEYOR_REPO_TAG_NAME) and !!process.env.PARTICLE_DEV_VERSION
else if (!!process.env.IS_RELEASE) and !!process.env.PARTICLE_DEV_VERSION
cb process.env.PARTICLE_DEV_VERSION
else
isRelease = false
Expand Down
6 changes: 3 additions & 3 deletions build/tasks/patch-code.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pathFile = (patchFile, targetFile) ->
patchFile = path.join(__dirname, 'patches', patchFile)
targetFile = path.join(workDir, targetFile.replace('/', path.sep))

command = 'patch -i ' + patchFile + ' ' + targetFile
command = 'patch --binary -i ' + patchFile + ' ' + targetFile
result = cp.exec command, (error, stdout, stderr) ->
if error
console.log '', patchFile, 'failed'
Expand Down Expand Up @@ -89,8 +89,8 @@ module.exports = (grunt) ->
pathFile 'darwin.patch', 'menus/darwin.cson'
]
else if process.platform is 'win32'
return pathFile 'win32.patch', 'menus/win32.cson'
else
# return pathFile 'win32.patch', 'menus/win32.cson'
else if process.platform is 'linux'
return pathFile 'linux.patch', 'menus/linux.cson'
]

Expand Down
30 changes: 30 additions & 0 deletions ci/darwin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
platform: darwin

params:
JANKY_BRANCH: stable
TRAVIS: 1
CI: 1
HOME: /Users/administrator
XCODE_KEYCHAIN: osx-build.keychain
ATOM_MAC_CODE_SIGNING_KEYCHAIN: osx-build.keychain
NODE_VERSION: 6.9.4
BUILD_NODE_VERSION: 6.9.4
BUILD_ATOM_RELEASES_S3_BUCKET: particle-dev-releases
IS_RELEASE: ((IS_RELEASE))
PARTICLE_DEV_VERSION: ((PARTICLE_DEV_VERSION))
ATOM_ACCESS_TOKEN: ((ATOM_ACCESS_TOKEN))
XCODE_KEYCHAIN_PASSWORD: ((XCODE_KEYCHAIN_PASSWORD))
KEY_PASSWORD: ((KEY_PASSWORD))
ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD: ((XCODE_KEYCHAIN_PASSWORD))
ATOM_MAC_CODE_SIGNING_CERT_PASSWORD: ((KEY_PASSWORD))
BUILD_ATOM_RELEASES_S3_KEY: ((BUILD_ATOM_RELEASES_S3_KEY))
BUILD_ATOM_RELEASES_S3_SECRET: ((BUILD_ATOM_RELEASES_S3_SECRET))

run:
path: sources/script/build-darwin

inputs:
- name: sources

outputs:
- name: artefacts
27 changes: 27 additions & 0 deletions ci/win-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
platform: windows

params:
NODE_ARCH: 64
JANKY_BRANCH: stable
TRAVIS: 1
CI: 1
BUILD_NODE_VERSION: 6.9.4
npm_config_runtime: electron
BUILD_ATOM_RELEASES_S3_BUCKET: particle-dev-releases
IS_RELEASE: ((IS_RELEASE))
ENCRYPTION_SECRET: ((ENCRYPTION_SECRET))
ATOM_ACCESS_TOKEN: ((ATOM_ACCESS_TOKEN))
KEY_PASSWORD: ((ATOM_WIN_CODE_SIGNING_CERT_PASSWORD))
ATOM_WIN_CODE_SIGNING_CERT_PASSWORD: ((ATOM_WIN_CODE_SIGNING_CERT_PASSWORD))
BUILD_ATOM_RELEASES_S3_KEY: ((BUILD_ATOM_RELEASES_S3_KEY))
BUILD_ATOM_RELEASES_S3_SECRET: ((BUILD_ATOM_RELEASES_S3_SECRET))

run:
path: powershell.exe
args: ["sources/script/build-windows.ps1"]

inputs:
- name: sources

outputs:
- name: artefacts
27 changes: 27 additions & 0 deletions ci/win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
platform: windows

params:
NODE_ARCH: 32
JANKY_BRANCH: stable
TRAVIS: 1
CI: 1
BUILD_NODE_VERSION: 6.9.4
npm_config_runtime: electron
BUILD_ATOM_RELEASES_S3_BUCKET: particle-dev-releases
IS_RELEASE: ((IS_RELEASE))
ENCRYPTION_SECRET: ((ENCRYPTION_SECRET))
ATOM_ACCESS_TOKEN: ((ATOM_ACCESS_TOKEN))
KEY_PASSWORD: ((ATOM_WIN_CODE_SIGNING_CERT_PASSWORD))
ATOM_WIN_CODE_SIGNING_CERT_PASSWORD: ((ATOM_WIN_CODE_SIGNING_CERT_PASSWORD))
BUILD_ATOM_RELEASES_S3_KEY: ((BUILD_ATOM_RELEASES_S3_KEY))
BUILD_ATOM_RELEASES_S3_SECRET: ((BUILD_ATOM_RELEASES_S3_SECRET))

run:
path: powershell.exe
args: ["sources/script/build-windows.ps1"]

inputs:
- name: sources

outputs:
- name: artefacts
4 changes: 2 additions & 2 deletions script/add-key.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
openssl aes-256-cbc -k %ENCRYPTION_SECRET% -in .\build\resources\particle-code-signing-cert.p12.enc -out .\build\resources\particle-code-signing-cert.p12 -d -a
certutil -p %KEY_PASSWORD% -user -importpfx .\build\resources\particle-code-signing-cert.p12 NoRoot
openssl aes-256-cbc -k %ENCRYPTION_SECRET% -md md5 -in %ATOM_WIN_CODE_SIGNING_ENC_CERT_PATH% -out %ATOM_WIN_CODE_SIGNING_CERT_PATH% -a -d
certutil -p %ATOM_WIN_CODE_SIGNING_CERT_PASSWORD% -user -importpfx .\build\resources\particle-code-signing-cert.p12 NoRoot
35 changes: 35 additions & 0 deletions script/build-darwin
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# set -e -x
function realpath { echo $(cd $(dirname $1); pwd)/$(basename $1); }

BASH_SOURCE_PATH=`dirname $BASH_SOURCE`
SCRIPT_PATH=`realpath $BASH_SOURCE_PATH`
BUILD_PATH=`realpath $SCRIPT_PATH/../build`
RESOURCES_PATH=$BUILD_PATH/resources

# Cache buster
# rm -rf sources/build/node_modules && rm -rf sources/dist/atom-work-dir/node_modules

# install
git clone https://github.com/creationix/nvm.git .nvm
source .nvm/nvm.sh
nvm install $BUILD_NODE_VERSION
nvm use --delete-prefix $BUILD_NODE_VERSION

cd sources
# before_script
export ATOM_MAC_CODE_SIGNING_CERT_PATH="$RESOURCES_PATH/key.p12"
./script/add-key
export JANKY_SHA1=`git rev-parse --short HEAD`
source .atomrc

# script
./script/build

# after_script
./script/remove-key
cd ..

# Move the artefacts
cp -R sources/dist/atom-work-dir/out/ artefacts
42 changes: 42 additions & 0 deletions script/build-windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
echo "--> Installing Node.js..."
$env:NVM_HOME = "c:\nvm"
$env:Path += ";$env:NVM_HOME"
#nvm install $env:BUILD_NODE_VERSION
nvm use $env:BUILD_NODE_VERSION $env:NODE_ARCH
$env:Path += ";$env:NVM_HOME\v$env:BUILD_NODE_VERSION"
#npm install -g npm

echo "--> Adding other dependencies..."
choco install patch
$env:Path += ";C:\ProgramData\chocolatey\lib\patch\tools\bin"
choco install git
$env:Path += ";C:\Program Files\Git\bin"
choco install 7zip
$env:Path += ";c:\program files\7-zip"

cd sources
echo "--> Adding signing key..."
choco install openssl.light
$env:Path += ";c:\Program Files\OpenSSL\bin"
$env:Pwd = (Get-Item -Path ".\" -Verbose).FullName
$env:ATOM_WIN_CODE_SIGNING_CERT_PATH = "$env:Pwd\build\resources\particle-code-signing-cert.p12"
$env:ATOM_WIN_CODE_SIGNING_ENC_CERT_PATH = "$env:Pwd\build\resources\particle-code-signing-cert.p12.enc"
.\script\add-key.cmd

# Set env
$env:USERPROFILE = "c:\home"
$env:Path += ";C:\Windows\SysWOW64\config\systemprofile\.windows-build-tools\python27\"
$env:Path += ";$env:NVM_HOME\v$env:BUILD_NODE_VERSION\node_modules\.bin"
$env:Path += ";$env:NVM_HOME\v$env:BUILD_NODE_VERSION\node_modules\npm\bin\node-gyp-bin"
$env:Path += ";$env:NVM_HOME\v$env:BUILD_NODE_VERSION\windows-build-tools\node_modules\.bin"
$env:GYP_MSVS_VERSION = "2015"

echo "--> Starting build..."
.\script\build.cmd
cd ..

echo "--> Copying artifacts..."
$env:Pwd = (Get-Item -Path ".\" -Verbose).FullName
$sourceDir = "c:\atom-work-dir\out"
$targetDir = "$env:Pwd\artefacts"
Get-ChildItem -Path $sourceDir | Copy-Item -Destination $targetDir -Recurse -Container

0 comments on commit cc0fba2

Please sign in to comment.