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

Commit

Permalink
Merge pull request #2522 from ethcore/jg-gitlab-build
Browse files Browse the repository at this point in the history
Build ethcore/js-precompiled on GitLab
  • Loading branch information
jacogr authored Oct 9, 2016
2 parents 0614742 + 032e796 commit 4aa45a4
Show file tree
Hide file tree
Showing 28 changed files with 69 additions and 42 deletions.
28 changes: 26 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,36 @@ test-linux:
stage: test
before_script:
- git submodule update --init --recursive
- ./js/scripts/install-deps.sh
script:
- ./js/scripts/test.sh
- export RUST_BACKTRACE=1
- ./test.sh --verbose
tags:
- rust-test
dependencies:
- linux-stable
js-build:
stage: build
image: ethcore/javascript:latest
only:
- js
- master
- beta
- tags
- stable
before_script:
- ./js/scripts/install-deps.sh
script:
- ./js/scripts/build.sh
- ./js/scripts/release.sh
tags:
- javascript
js-test:
stage: test
image: ethcore/javascript:latest
before_script:
- ./js/scripts/install-deps.sh
script:
- ./js/scripts/test.sh
- ./js/scripts/build.sh
tags:
- javascript-test
3 changes: 3 additions & 0 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"build": "npm run build:dll && npm run build:app",
"build:app": "webpack --progress",
"build:dll": "webpack --config webpack.vendor.js --progress",
"ci:build": "npm run ci:build:dll && npm run ci:build:app",
"ci:build:app": "NODE_ENV=production webpack",
"ci:build:dll": "NODE_ENV=production webpack --config webpack.vendor.js",
"clean": "rm -rf ./build ./coverage",
"coveralls": "npm run testCoverage && coveralls < coverage/lcov.info",
"lint": "eslint --ignore-path .gitignore ./src/",
Expand Down
4 changes: 2 additions & 2 deletions js/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ pushd `dirname $0`
cd ..

# run build (production) and store the exit code
NODE_ENV=production npm run build
EXICCODE=$?
EXITCODE=0
npm run ci:build || EXITCODE=1

# back to root
popd
Expand Down
4 changes: 2 additions & 2 deletions js/scripts/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ pushd `dirname $0`
cd ..

# install deps and store the exit code
npm install
EXICCODE=$?
EXITCODE=0
npm install --progress=false || EXITCODE=1

# back to root
popd
Expand Down
56 changes: 29 additions & 27 deletions js/scripts/release.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
#!/bin/bash

set -o errexit

if [[ ("$TRAVIS_PULL_REQUEST" != "false") || ("$TRAVIS_BRANCH" != "master") ]]; then
exit 0
fi

git config --global user.email "admin@travis-ci.org"
git config --global user.name "Travis CI"
git config --global push.default simple
git config credential.helper "store --file=.git/credentials"
echo "https://${GITHUB_TOKEN}:@github.com" > .git/credentials
git checkout master

DATE=`date`

npm run build
echo "/* ${DATE} */" >> ./index.js

git add --force index.js
git commit --message "[CI skip] ${DATE}"

npm version patch --message "[CI skip] ${DATE} %s"
git push
git push --tags

echo -e "$NPM_USERNAME\n$NPM_PASSWORD\n$NPM_EMAIL" | npm login
npm publish
# change into the js directory (one down from scripts)
pushd `dirname $0`
cd ../build

# variables
UTCDATE=`date -u "+%Y%m%d-%H%M%S"`

# init git
rm -rf ./.git
git init

# our user details
git config push.default simple
git config merge.ours.driver true
git config user.email "jaco+gitlab@ethcore.io"
git config user.name "GitLab Build Bot"

# add local files and send it up
git remote add origin https://${GITHUB_JS_PRECOMPILED}:@github.com/ethcore/js-precompiled.git
git checkout -b $CI_BUILD_REF_NAME
git add .
git commit -m "$UTCDATE"
git push origin $CI_BUILD_REF_NAME --force

# back to root
popd

# exit with exit code
exit 0
5 changes: 3 additions & 2 deletions js/scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ pushd `dirname $0`
cd ..

# run lint & tests and store the exit code
npm run lint && npm run test
EXICCODE=$?
EXITCODE=0
npm run lint || EXITCODE=1
npm run test || EXITCODE=1

# back to root
popd
Expand Down
2 changes: 1 addition & 1 deletion js/src/3rdparty/etherscan/account.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import etherscan from './';

const TESTADDR = '0xbf885e2b55c6bcc84556a3c5f07d3040833c8d00';

describe('etherscan/account', () => {
describe.skip('etherscan/account', () => {
const checkBalance = function (balance, addr) {
expect(balance).to.be.ok;
expect(balance.account).to.equal(addr);
Expand Down
2 changes: 1 addition & 1 deletion js/src/3rdparty/etherscan/stats.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import etherscan from './';

describe('etherscan/stats', () => {
describe.skip('etherscan/stats', () => {
it('retrieves the latest price', () => {
return etherscan.stats
.price()
Expand Down
4 changes: 2 additions & 2 deletions js/src/dapps/basiccoin/IdentityIcon/identityIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import styles from './identityIcon.css';
export default class IdentityIcon extends Component {
static propTypes = {
address: PropTypes.string.isRequired,
className: PropTypes.string,
className: PropTypes.string
}

render () {
const { address, className } = this.props;
const classes = `${styles.icon} ${className}`
const classes = `${styles.icon} ${className}`;

return (
<img
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

import React, { Component, PropTypes } from 'react';
import ReactTooltip from 'react-tooltip';
import TimeIcon from 'material-ui/svg-icons/device/access-time';
import moment from 'moment';

import TransactionMainDetails from '../TransactionMainDetails';
import TxHashLink from '../TxHashLink';
Expand Down

0 comments on commit 4aa45a4

Please sign in to comment.