Skip to content

Commit

Permalink
Docker image build has no prerequisites now
Browse files Browse the repository at this point in the history
  • Loading branch information
korczis committed Apr 27, 2018
1 parent 895f875 commit b0bc901
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 20 deletions.
7 changes: 3 additions & 4 deletions .dockerignore
Expand Up @@ -9,8 +9,7 @@ Dockerfile
protoc-3.5.1-linux-x86_64.zip

# Git stuff
.git
!.git/ORIG_HEAD
# .git

# Runtime data
pids
Expand Down Expand Up @@ -46,10 +45,10 @@ src/native/artifacts.json
src/native/target/
src/protos/*.js
root/
rust/target/
rust/bcrust-core/target/
target/
tmp/

# .version.json
.version.json

/snippets/
5 changes: 0 additions & 5 deletions Dockerfile
Expand Up @@ -47,9 +47,7 @@ RUN yarn

# Add and build native (rust) stuff
ADD native native
RUN rm -rf native/target
ADD rust rust
RUN rm -rf rust/target

ADD protos protos
ADD src/protos src/protos
Expand All @@ -62,9 +60,6 @@ COPY . .
# Install packages
RUN yarn

# Copy .version.json
COPY .version.json .

# Initial transpile
RUN yarn transpile

Expand Down
7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -17,13 +17,13 @@
"transpile": "babel src --source-maps=true --config-file ./.babelrc --out-dir lib --ignore ./lib/,./node_modules,./.babelrc,./package.json,./npm-debug.log",
"test": "jest",
"build-native": "neon build",
"build": "yarn run version:generate && yarn run lint:flow && yarn run lint:standard && yarn run transpile --copy-files && yarn run webpack",
"build-windows": "yarn run version:generate && yarn run lint:standard && yarn run transpile --copy-files && yarn run webpack",
"build": "yarn run lint:flow && yarn run lint:standard && yarn run transpile --copy-files && yarn run version:generate && yarn run webpack",
"build-windows": "yarn run lint:standard && yarn run transpile --copy-files && yarn run version:generate && yarn run webpack",
"dist": "yarn && yarn run proto && yarn run build-native && yarn run build && yarn test --ci --coverage && yarn run nsp check --threshold 7 && yarn run outdated && yarn run doc",
"dist-windows": "yarn && yarn run build-native && yarn test --ci --coverage && yarn run nsp check --threshold 7 && yarn run outdated && yarn run doc",
"outdated": "yarn outdated || true",
"pkg": "pkg package.json --out-path=dist",
"version:generate": "babel-node ./scripts/version-generate.js",
"version:generate": "node ./scripts/version-generate.js",
"watch:lint": "onchange src/**/*.es6 -- yarn run lint:standard",
"watch:transpile": "onchange src/**/*.es6 -- babel {{changed}} --source-maps=true --config-file ./.babelrc --out-dir lib --ignore lib,node_modules",
"watch:test": "jest --watch",
Expand Down Expand Up @@ -185,6 +185,7 @@
"ramda": "^0.25.0",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-helmet": "^5.2.0",
"react-redux": "^5.0.7",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
Expand Down
7 changes: 4 additions & 3 deletions scripts/version-generate.js
@@ -1,11 +1,12 @@
#! /usr/bin/env babel-node

const { getVersion } = require('../src/helper/version')
const { generateVersionFile } = require('../lib/helper/version')

if (getVersion) {
if (generateVersionFile) {
try {
console.log('Generating .version.json file')
getVersion()
var version = generateVersionFile()
console.log(JSON.stringify(version, null, 2))
} catch (err) {
console.log('Unable to generate .version.json file', err)
}
Expand Down
16 changes: 15 additions & 1 deletion src/helper/version.es6
Expand Up @@ -77,9 +77,23 @@ export const getVersion = (path: string = VERSION_FILE_PATH) => {
}

const version = generateVersion()
if (version) {
writeVersionFile(path, version)
}

return generateVersionFile(path)
}

/**
* Get version object
*
* @param path
* @return {Object}
*/
export const generateVersionFile = (path: string = VERSION_FILE_PATH) => {
const version = generateVersion()
if (version) {
writeVersionFile(path, generateVersion())
writeVersionFile(path, version)
}

return version
Expand Down
32 changes: 28 additions & 4 deletions yarn.lock
Expand Up @@ -3335,14 +3335,14 @@ decompress@^4.0.0:
pify "^2.3.0"
strip-dirs "^2.0.0"

deep-equal@^1.0.1, deep-equal@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5"

deep-equal@~0.2.1:
version "0.2.2"
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-0.2.2.tgz#84b745896f34c684e98f2ce0e42abaf43bba017d"

deep-equal@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5"

deep-extend@^0.4.0, deep-extend@~0.4.0:
version "0.4.2"
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f"
Expand Down Expand Up @@ -4532,6 +4532,10 @@ execa@^0.7.0:
signal-exit "^3.0.0"
strip-eof "^1.0.0"

exenv@^1.2.1:
version "1.2.2"
resolved "https://registry.yarnpkg.com/exenv/-/exenv-1.2.2.tgz#2ae78e85d9894158670b03d47bec1f03bd91bb9d"

exit-hook@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8"
Expand Down Expand Up @@ -10092,6 +10096,15 @@ react-dom@^16.3.2:
object-assign "^4.1.1"
prop-types "^15.6.0"

react-helmet@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-5.2.0.tgz#a81811df21313a6d55c5f058c4aeba5d6f3d97a7"
dependencies:
deep-equal "^1.0.1"
object-assign "^4.1.1"
prop-types "^15.5.4"
react-side-effect "^1.1.0"

react-redux@^5.0.7:
version "5.0.7"
resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-5.0.7.tgz#0dc1076d9afb4670f993ffaef44b8f8c1155a4c8"
Expand Down Expand Up @@ -10134,6 +10147,13 @@ react-router@^4.2.0:
prop-types "^15.5.4"
warning "^3.0.0"

react-side-effect@^1.1.0:
version "1.1.5"
resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-1.1.5.tgz#f26059e50ed9c626d91d661b9f3c8bb38cd0ff2d"
dependencies:
exenv "^1.2.1"
shallowequal "^1.0.1"

react@^16.3.2:
version "16.3.2"
resolved "https://registry.yarnpkg.com/react/-/react-16.3.2.tgz#fdc8420398533a1e58872f59091b272ce2f91ea9"
Expand Down Expand Up @@ -11054,6 +11074,10 @@ sha3@^1.1.0, sha3@^1.2.0:
dependencies:
nan "^2.0.5"

shallowequal@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.0.2.tgz#1561dbdefb8c01408100319085764da3fcf83f8f"

shebang-command@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
Expand Down

0 comments on commit b0bc901

Please sign in to comment.