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

Feature: Setup vsts builds & switch from yarn to npm 5 #1479

Merged
merged 92 commits into from
Jul 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
230f43d
linux build
timotheeguerin Jun 29, 2018
c8f9dcc
tweak
timotheeguerin Jun 29, 2018
8a6163a
tweak
timotheeguerin Jun 29, 2018
7592090
tweak
timotheeguerin Jun 29, 2018
dabf59d
tweak
timotheeguerin Jun 29, 2018
c314fae
tweak
timotheeguerin Jun 29, 2018
7f6417a
tweak
timotheeguerin Jun 29, 2018
2d45a25
wip
timotheeguerin Jun 29, 2018
0bf485e
wip
timotheeguerin Jun 29, 2018
ed47fa8
wip
timotheeguerin Jun 29, 2018
8aa0a59
wip
timotheeguerin Jun 29, 2018
253ee7d
wip
timotheeguerin Jun 29, 2018
37625ce
wip
timotheeguerin Jun 29, 2018
17ef41f
wip
timotheeguerin Jun 29, 2018
e7d8163
wip
timotheeguerin Jun 29, 2018
f72eadd
wip
timotheeguerin Jun 29, 2018
a8fe2b9
wip
timotheeguerin Jun 29, 2018
49cc135
wip
timotheeguerin Jun 29, 2018
4ecf6f5
wip
timotheeguerin Jun 29, 2018
a23c2bd
wip
timotheeguerin Jun 29, 2018
cef399f
wip
timotheeguerin Jun 29, 2018
eedea0f
wip
timotheeguerin Jun 29, 2018
8222af8
wip
timotheeguerin Jun 29, 2018
4b567e0
wip
timotheeguerin Jun 29, 2018
aaabb22
wip
timotheeguerin Jun 29, 2018
ea90fca
wip
timotheeguerin Jun 29, 2018
a644705
wip
timotheeguerin Jun 29, 2018
9478c68
wip
timotheeguerin Jun 29, 2018
f510b82
wip
timotheeguerin Jun 29, 2018
1a1b85f
wip
timotheeguerin Jun 29, 2018
29984b1
wip
timotheeguerin Jun 29, 2018
1572c28
wip
timotheeguerin Jun 29, 2018
1bc7da5
wip
timotheeguerin Jun 29, 2018
02271d9
wip
timotheeguerin Jun 29, 2018
be6cd04
wip
timotheeguerin Jun 29, 2018
2c71026
wip
timotheeguerin Jun 29, 2018
ba19b16
wip
timotheeguerin Jun 29, 2018
f67f960
tweaks
timotheeguerin Jul 1, 2018
d73e59a
tweaks
timotheeguerin Jul 1, 2018
355a9f9
tweaks
timotheeguerin Jul 1, 2018
4b997a6
tweaks
timotheeguerin Jul 1, 2018
7a6a9fd
tweaks
timotheeguerin Jul 1, 2018
bc838d7
tweaks
timotheeguerin Jul 1, 2018
12f6bb3
tweaks
timotheeguerin Jul 1, 2018
30c0e60
tweaks
timotheeguerin Jul 1, 2018
59ead28
tweaks
timotheeguerin Jul 1, 2018
6e1d1b9
tweaks
timotheeguerin Jul 1, 2018
487f339
tweaks
timotheeguerin Jul 1, 2018
9aaa5d4
tweaks
timotheeguerin Jul 1, 2018
7cbb935
tweaks
timotheeguerin Jul 1, 2018
f40f931
tweaks
timotheeguerin Jul 1, 2018
faaadbe
tweaks
timotheeguerin Jul 1, 2018
a6b8dc6
tweaks
timotheeguerin Jul 1, 2018
f30ec2c
tweaks
timotheeguerin Jul 1, 2018
e668636
tweaks enable shared
timotheeguerin Jul 1, 2018
12d238e
More vsts
timotheeguerin Jul 2, 2018
47b9475
More vsts
timotheeguerin Jul 2, 2018
19f5849
More vsts
timotheeguerin Jul 2, 2018
4d346df
More vsts
timotheeguerin Jul 2, 2018
0ea10e4
More vsts
timotheeguerin Jul 2, 2018
f4db4d6
More vsts
timotheeguerin Jul 2, 2018
751e532
More vsts
timotheeguerin Jul 2, 2018
2f5c249
More vsts
timotheeguerin Jul 2, 2018
63df6e6
More vsts
timotheeguerin Jul 2, 2018
e749479
try
timotheeguerin Jul 2, 2018
9e4f2f7
Tweaks
timotheeguerin Jul 2, 2018
6bf64cb
update?
timotheeguerin Jul 2, 2018
11eabc9
try
timotheeguerin Jul 2, 2018
2fc161c
revert
timotheeguerin Jul 2, 2018
a6b5625
revert
timotheeguerin Jul 2, 2018
6be9477
Remove lock
timotheeguerin Jul 2, 2018
d895c1d
Remove lock
timotheeguerin Jul 2, 2018
2e2375c
try no pyenv osx
timotheeguerin Jul 2, 2018
2304fbe
try no pyenv osx
timotheeguerin Jul 2, 2018
ad65da4
try no pyenv osx
timotheeguerin Jul 2, 2018
b812edf
update dep of dep
timotheeguerin Jul 2, 2018
04e6b8e
update dep of dep
timotheeguerin Jul 2, 2018
2f52d85
update dep of dep
timotheeguerin Jul 2, 2018
cb7f2fb
try npm
timotheeguerin Jul 2, 2018
5bdd176
remove ms-rest-js
timotheeguerin Jul 2, 2018
582f65e
Some tweaks
timotheeguerin Jul 2, 2018
a68e0cb
Reneable linux
timotheeguerin Jul 2, 2018
f3df785
segments?
timotheeguerin Jul 2, 2018
7aadfd2
segments2?
timotheeguerin Jul 2, 2018
5e7d44a
segmentsv1?
timotheeguerin Jul 2, 2018
8e00882
remove yarn
timotheeguerin Jul 2, 2018
150b8d1
remove yarn from travis
timotheeguerin Jul 2, 2018
07ccf40
Merge branch 'master' into feature/vsts-build
timotheeguerin Jul 2, 2018
bd7f970
Travis tweaks
timotheeguerin Jul 2, 2018
79b5d17
Merge branch 'feature/vsts-build' of https://github.com/Azure/BatchLa…
timotheeguerin Jul 2, 2018
add8b48
Remove yarn leftover
timotheeguerin Jul 2, 2018
e2c6c1d
Remove yarn leftover
timotheeguerin Jul 2, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,7 @@ python:
- "3.6"

matrix:
fast_finish: true
allow_failures:
os: osx # This allows not to wait for the osx build to be scheduled

include:
- language: generic
os: osx
before_install:
- brew update
- brew upgrade python
- brew install python@2
- python --version
- python3 --version
- which python
- npm config set python python2.7
- nvm install 9.6.1
- nvm use 9.6.1

- language: node_js
os: linux
services: docker
Expand All @@ -53,10 +36,9 @@ matrix:
- sleep 3

install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16; fi
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
- npm install -g codecov
- npm install -g yarn
- yarn --ignore-engines install
- npm install
- python3 --version
- pip3 install -r python/requirements.txt

Expand All @@ -68,7 +50,6 @@ branches:
only:
- master
- stable
- fix/publish

cache:
# yarn: true
Expand Down
4 changes: 4 additions & 0 deletions .vsts/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.11.x'
97 changes: 97 additions & 0 deletions .vsts/pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: $(SourceBranch)$(Rev:.r)
phases:
- phase: Linux
queue: Hosted Linux Preview
steps:
- script: |
set -e
apt-get update
apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 libgconf-2-4 dbus xvfb libgtk-3-0
displayName: Install Linux packages
- template: ./dependencies.yml
- template: ./pyenv.yml
- script: |
set -e
python --version
npm install -g codecov
npm install
pip3 install -r python/requirements.txt
displayName: Install dependencies

- script: |
export DISPLAY=:99
xvfb-run npm run test
displayName: Run tests

- task: PublishTestResults@2
inputs:
testRunner: 'JUnit'
testResultsFiles: $(System.DefaultWorkingDirectory)/coverage/TESTS*.xml

- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: cobertura
summaryFileLocation: $(System.DefaultWorkingDirectory)/coverage/cobertura.xml
reportDirectory: $(System.DefaultWorkingDirectory)/coverage/html

- script: npm run build-and-pack
displayName: Build and pack

- script: npm run lint
displayName: Lint

- task: PublishBuildArtifacts@1
displayName: Publish artifacts
inputs:
pathtoPublish: ./release
artifactName: linux
artifactType: Container

# Mac os build
- phase: macOS
queue: Hosted macOS Preview
steps:
- template: ./dependencies.yml
- script: npm config set python $(which python)
displayName: Set npm python2 path
- template: ./pyenv.yml
- script: |
set -e
node --version
npm config list
npm install
pip install -r python/requirements.txt
displayName: Install dependencies

- script: npm run build-and-pack
displayName: Build and pack

- task: PublishBuildArtifacts@1
displayName: Publish artifacts
inputs:
pathtoPublish: ./release
artifactName: osx
artifactType: Container

- phase: Windows
queue: Hosted VS2017
steps:
- template: ./dependencies.yml
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6.x'
- powershell: |
node --version
npm install
pip install -r python/requirements.txt
displayName: Install dependencies

- powershell: npm run build-and-pack
displayName: Build and pack

- task: PublishBuildArtifacts@1
displayName: Publish artifacts
inputs:
pathtoPublish: ./release
artifactName: windows
artifactType: Container
14 changes: 14 additions & 0 deletions .vsts/pyenv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
steps:
- script: |
set -e
export PYENV_ROOT="$(Agent.WorkFolder)/.pyenv"
git clone https://github.com/pyenv/pyenv.git $PYENV_ROOT
export PATH="$PYENV_ROOT/bin:$PATH"
pyenv --version
PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.6.6
pyenv global 3.6.6
python --version
echo "Path is $PATH"
echo "##vso[task.prependpath]$PYENV_ROOT/bin"
echo "##vso[task.prependpath]$PYENV_ROOT/shims"
displayName: Install python
6 changes: 2 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You can download the latest version at https://github.com/Azure/BatchLabs/releas

## Building batchlabs yourself
#### 1. Prerequisites
- **Install node.js version `6.9` or greater. [Download](https://nodejs.org/en/download/)**
- **Install node.js version `8` or greater. [Download](https://nodejs.org/en/download/)**
- Install python **3.6** (doesn't need to be in the path if that breaks your environment)

#### 2. Clone the repo
Expand All @@ -35,11 +35,9 @@ Call this command and it will check you have everything setup correctly and buil

#### 4. Install the dependencies
```bash
npm install -g yarn
yarn install
npm install
pip3 install -r python/requirements.txt # or pip if on windows or only have python 3.6 installed
```
Note: You can also use `npm install` at your own risk. However please do not submit an issue if you didn't use `yarn install`. Yarn will make sure you have the right set of dependencies, which reduces the likelihood of any unexpected build issues relating to third party packages.

#### 4.5 Setup some configuration(Only in certain case)
If you didn't installed python in the path you will need to let batchlabs know where it is.
Expand Down
11 changes: 3 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,13 @@ install:

- ps: Install-Product node 8.9.1 x64
- npm install -g npm -s
- npm install -g yarn -s
- yarn install --force
- npm install
- pip install -r python/requirements.txt

build_script:
- npm run -s build:prod
- npm run -s build-python
- IF [%APPVEYOR_REPO_BRANCH%]==[stable] (
npm run -s package -- --publish always --draft --win
) ELSE (
npm run -s package -- --publish never
)
- npm run -s package -- --publish never

test_script:
# - npm run test -s
Expand All @@ -43,4 +38,4 @@ artifacts:
name: Batchlabs-windows-setup.exe
- path: release\*win.zip
name: Batchlabs-windows.zip

2 changes: 1 addition & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## 1. Prerequisites
Follow the **Building batchlabs yourself** instruction of the [main readme](../Readme.md) in order to install all require dependencies.

**Use `yarn install` instead of `npm install`. This ensures a consistent build environment with the right set of dependencies [Migrating from npm to yarn](https://yarnpkg.com/lang/en/docs/migrating-from-npm/)**
**Use `npm` 5 and above. This ensures a consistent build environment with the right set of dependencies**

Start the dev server
```bash
Expand Down
10 changes: 8 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const webpackConfig = require("./config/webpack.config.test");
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = "true";

// Only enable coverage if env is defined(So we don't enable it in watch mode as it duplicate logs)
const coverageReporters = process.env.COVERAGE ? ["coverage", "remap-coverage"] : [];
const coverageReporters = process.env.COVERAGE ? ["coverage", "remap-coverage", "junit"] : [];

// Karma config for testing the code running the browser environemnt.
// For the client testing use the mocha command line.
module.exports = function(config) {
Expand Down Expand Up @@ -82,7 +83,12 @@ module.exports = function(config) {
remapCoverageReporter: {
"text-summary": null,
json: "./coverage/coverage.json",
html: "./coverage/html"
html: "./coverage/html",
cobertura: "./coverage/cobertura.xml",
},
// Can't enable yet has a conflict in dependency with azure-storage
junitReporter: {
outputDir: "./coverage"
}
});
};
Loading