Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
Release 3.0.0 (#161)
Browse files Browse the repository at this point in the history
Release 3.0.0
  • Loading branch information
thinkh authored Dec 20, 2019
2 parents d6d337d + 65972fa commit 7d80cd4
Show file tree
Hide file tree
Showing 25 changed files with 2,111 additions and 1,299 deletions.
65 changes: 53 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,46 @@ jobs:
build:
working_directory: ~/phovea
docker:
- image: caleydo/phovea_circleci_python:v1.0
tags:
- /v\d+.\d+.\d+.*/
- image: caleydo/phovea_circleci_python:v3.0
steps:
- checkout
- run:
name: Show Node.js and npm version
command: |
node -v
npm -v
- run:
name: Show Python and pip version
command: |
python --version
pip --version
- run:
name: Install Docker packages from docker_packages.txt
command: |
(!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs sudo apt-get install -y))
- restore_cache:
key: deps2-{{ .Branch }}-{{ checksum "package.json" }}
- run:
name: install-npm-wee
name: Install npm dependencies
command: npm install
- run: #remove all resolved github dependencies
name: delete-vcs-dependencies
- run:
name: Remove npm dependencies installed from git repositories (avoid caching of old commits)
command: |
(grep -l '._resolved.: .\(git[^:]*\|bitbucket\):' ./node_modules/*/package.json || true) | xargs -r dirname | xargs -r rm -rf
- save_cache:
key: deps2-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- ./node_modules
- run: #install all dependencies
name: install-npm-wee2
- run:
name: Install npm dependencies from git repositories (always get latest commit)
command: npm install
- run:
name: Show installed npm dependencies
command: npm list --depth=1 || true
- restore_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
- run:
name: install-pip-wee
name: Install pip requirements
command: |
virtualenv ~/venv
. ~/venv/bin/activate
Expand All @@ -40,16 +52,45 @@ jobs:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
paths:
- ~/venv
- run: #force update of VCS dependencies?
name: update-pip-vcs-dependencies
- run:
name: Force an update of pip dependencies from git repositories # not sure if this is working ?
command: |
. ~/venv/bin/activate
pip install --upgrade --upgrade-strategy=only-if-needed -r requirements.txt
- run:
name: dist
name: Show installed pip packages
command: pip list || true
- run:
name: Build
command: |
. ~/venv/bin/activate
npm run dist
- store_artifacts:
path: dist
prefix: dist
workflows:
version: 2
# build-nightly:
# triggers:
# - schedule:
# cron: "15 1 * * 1-5" # "At 01:15 on every day-of-week from Monday through Friday.”, see: https://crontab.guru/#15_1_*_*_1-5
# filters:
# branches:
# only:
# - develop
# jobs:
# - build
build-branch:
jobs:
- build:
filters:
tags:
ignore: /^v.*/
build-tag:
jobs:
- build:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ node_modules/
/tests/**/*.js
*.map
*.css
/.cache-loader
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: caleydo/phovea_circleci_python:v1.0
image: caleydo/phovea_circleci_python:v3.0

variables:
GIT_DEPTH: "1"
Expand Down
10 changes: 8 additions & 2 deletions .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@
],
"entries": "./index.js",
"ignores": [],
"today": "Sun, 06 Nov 2016 12:25:08 GMT"
"today": "Sun, 06 Nov 2016 12:25:08 GMT",
"promptValues": {
"authorName": "The Caleydo Team",
"authorEmail": "contact@caleydo.org",
"authorUrl": "https://caleydo.org",
"githubAccount": "phovea"
}
}
}
}
7 changes: 4 additions & 3 deletions buildInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function gitHead(cwd) {

function resolveModules() {
const reg = fs.readFileSync('../phovea_registry.js').toString();
const regex = /import '(.*)\/phovea_registry.js'/g;
const regex = /^import '(.*)\/phovea_registry.js'/gm;
const modules = [];
let r;
while ((r = regex.exec(reg)) !== null) {
Expand All @@ -56,7 +56,7 @@ function resolveWorkspace() {
let deps = null;
const resolveModule = (m) => {
console.log('resolve', m);
const pkg = require(`../${m}/package.json`);
const pkg = JSON.parse(fs.readFileSync(`../${m}/package.json`).toString());
const head = gitHead('../' + m);
const repo = pkg.repository.url;
return {
Expand Down Expand Up @@ -139,14 +139,15 @@ function resolveScreenshot() {
if (!fs.existsSync(f)) {
return null;
}
const buffer = new Buffer(fs.readFileSync(f)).toString('base64');
const buffer = Buffer.from(fs.readFileSync(f)).toString('base64');
return `data:image/png;base64,${buffer}`;
}

function metaData(pkg) {
pkg = pkg || require(`./package.json`);
return {
name: pkg.name,
displayName: pkg.displayName,
version: pkg.version,
repository: pkg.repository.url,
homepage: pkg.homepage,
Expand Down
13 changes: 5 additions & 8 deletions buildPython.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
*/

const spawnSync = require('child_process').spawnSync;
const path = require('path');
const resolve = path.resolve;
const fs = require('fs');

function gitHead(cwd) {
Expand All @@ -26,7 +24,7 @@ function resolvePlugin(repo, version) {
}
}
// not a git repo
return version
return version;
}

function toVersion(v) {
Expand All @@ -35,8 +33,8 @@ function toVersion(v) {
const fmt = now
.replace(/T/, ' ')
.replace(/\..+/, '')
.replace(/[-:]/,'')
.replace(' ','-');
.replace(/[-:]/, '')
.replace(' ', '-');
return v.replace('SNAPSHOT', fmt);
}

Expand All @@ -55,18 +53,17 @@ function _main() {
repository: (pkg.repository || {}).url
};

const l = ('build/source/' + name).split('/');
const l = ('build/source/' + name.toLowerCase()).split('/');
l.forEach((_, i) => {
const path = l.slice(0, i + 1).join('/');
if (!fs.existsSync(path)) {
fs.mkdirSync(path);
}
});

fs.writeFileSync('build/source/' + name + '/buildInfo.json', JSON.stringify(buildInfo, null, ' '));
fs.writeFileSync('build/source/' + name.toLowerCase() + '/buildInfo.json', JSON.stringify(buildInfo, null, ' '));
}


if (require.main === module) {
_main();
}
1 change: 1 addition & 0 deletions deploy/docker-compose.partial.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version: '2.0'
Loading

0 comments on commit 7d80cd4

Please sign in to comment.