Skip to content
Snippets Groups Projects
Commit c5028cd0 authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

Merge branch 'ga-ci' into hindawi-theme

parents 163147e4 d59f9c59
No related branches found
No related tags found
1 merge request!43Sprint #19
......@@ -50,6 +50,8 @@ test:
push:qa:
image: docker:latest
stage: push
variables:
NODE_ENV: test
only:
- develop
script:
......@@ -72,6 +74,8 @@ push:demo:
image: docker:latest
stage: push
when: manual
variables:
NODE_ENV: production
script:
# Setup
- export AWS_REGION="eu-west-1"
......@@ -93,6 +97,8 @@ push:staging:
stage: push
only:
- master
variables:
NODE_ENV: production
script:
# Setup
- export AWS_REGION="eu-west-1"
......@@ -133,6 +139,7 @@ deploy:qa:
only:
- develop
variables:
NODE_ENV: test
PACKAGE_NAME: xpub-faraday
IMAGE_TAG: latest
environment:
......@@ -151,6 +158,7 @@ deploy:staging:
variables:
PACKAGE_NAME: xpub-faraday
IMAGE_TAG: staging
NODE_ENV: production
environment:
name: staging
url: http://faraday.hindawi.com
......
......@@ -13,6 +13,7 @@ RUN [ "yarn", "cache", "clean"]
RUN [ "rm", "-rf", "/npm-packages-offline-cache"]
ENV NODE_ENV "production"
WORKDIR ${HOME}/packages/xpub-faraday
RUN [ "npx", "pubsweet", "build"]
......
......@@ -16,6 +16,7 @@ const Textarea = styled.textarea`
font-family: ${th('fontWriting')};
padding: ${th('gridUnit')};
width: 100%;
resize: vertical;
${minHeight};
${marginHelper};
......
......@@ -5,6 +5,7 @@
<!--
Build time: <%= htmlWebpackPlugin.options.buildTime %>
-->
<%= htmlWebpackPlugin.options.gaHead %>
<meta charset=utf-8>
<title>
<%= htmlWebpackPlugin.options.title %>
......@@ -13,6 +14,7 @@
</head>
<body>
<%= htmlWebpackPlugin.options.gaBody %>
<div id="root"></div>
</body>
......
......@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title> Faraday </title>
<title> Hindawi Review </title>
<link xmlns="http://www.w3.org/1999/xhtml" rel="shortcut icon" href="/assets/favicon.ico" type="image/x-icon" />
</head>
<body style="margin: 0;">
......
......@@ -46,7 +46,7 @@ module.exports = {
API_ENDPOINT: '/api',
baseUrl: process.env.CLIENT_BASE_URL || 'http://localhost:3000',
'login-redirect': '/',
'redux-log': true, // process.env.NODE_ENV !== 'production',
'redux-log': process.env.NODE_ENV !== 'production',
theme: process.env.PUBSWEET_THEME,
},
orcid: {
......
......@@ -6,22 +6,26 @@ module.exports = {
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/pdf',
'application/msword',
'application/vnd.oasis.opendocument.tex',
'application/rdf+xml',
])
.error(new Error('Only Word documents and PDFs are allowed')),
.error(new Error('Document type is not allowed.')),
supplementary: Joi.any(),
coverLetter: Joi.any()
.valid([
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/pdf',
'application/msword',
'application/vnd.oasis.opendocument.tex',
'application/rdf+xml',
])
.error(new Error('Only Word documents and PDFs are allowed')),
.error(new Error('Document type is not allowed.')),
responseToReviewers: Joi.any()
.valid([
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/pdf',
'application/msword',
])
.error(new Error('Only Word documents and PDFs are allowed')),
.error(new Error('Document type is not allowed.')),
review: Joi.any(),
}
......@@ -8,11 +8,11 @@
"url": "https://gitlab.coko.foundation/xpub/xpub-faraday"
},
"dependencies": {
"@pubsweet/ui": "^8.6.0",
"@pubsweet/styleguide": "3.1.4",
"@pubsweet/ui-toolkit": "latest",
"@pubsweet/component-aws-s3": "^1.2.0",
"@pubsweet/component-send-email": "0.2.4",
"@pubsweet/styleguide": "3.1.4",
"@pubsweet/ui": "^8.6.0",
"@pubsweet/ui-toolkit": "latest",
"aws-sdk": "^2.197.0",
"babel-core": "^6.26.0",
"config": "^1.26.2",
......@@ -28,9 +28,9 @@
"prop-types": "^15.5.10",
"pubsweet": "^2.2.1",
"pubsweet-client": "^4.0.4",
"pubsweet-server": "2.0.3",
"pubsweet-component-login": "^1.1.0",
"pubsweet-component-signup": "^1.0.0",
"pubsweet-server": "2.0.3",
"react": "^16.4.2",
"react-dnd": "^2.5.4",
"react-dnd-html5-backend": "^2.5.4",
......@@ -62,8 +62,8 @@
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.5",
"html-webpack-plugin": "^2.24.0",
"joi-browser": "^10.0.6",
"jest": "^22.1.1",
"joi-browser": "^10.0.6",
"react-hot-loader": "^3.1.1",
"string-replace-loader": "^1.3.0",
"style-loader": "^0.19.0",
......
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const include = require('./babel-includes')
const stringReplaceRule = require('./string-replace')
module.exports = [
stringReplaceRule,
{
oneOf: [
// ES6 JS
{
test: /\.jsx?$/,
include,
loader: 'babel-loader',
options: {
presets: [
[require('babel-preset-env'), { modules: false }],
require('babel-preset-react'),
require('babel-preset-stage-2'),
],
},
},
// CSS Modules
{
test: /\.local\.css$/,
include,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
modules: true,
localIdentName: '[name]_[local]-[hash:base64:8]',
},
},
],
}),
},
// global CSS
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader'],
}),
},
// files
{
exclude: [/\.jsx?$/, /\.html$/, /\.json$/],
loader: 'file-loader',
options: {
name: 'static/media/[name].[hash:8].[ext]',
},
},
],
},
]
......@@ -36,10 +36,27 @@ module.exports = [
root: path.join(__dirname, '..', '_build'),
}),
new HtmlWebpackPlugin({
title: 'Faraday',
title: 'Hindawi Review',
buildTime: new Date().toString(),
template: '../app/index-production.html',
inject: 'body',
gaHead: `<!-- Google Tag Manager -->
<script>(function (w, d, s, l, i) {
w[l] = w[l] || []; w[l].push({
'gtm.start':
new Date().getTime(), event: 'gtm.js'
}); var f = d.getElementsByTagName(s)[0],
j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =
'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', '${
process.env.GA_KEY
}');</script>
<!-- End Google Tag Manager -->`,
gaBody: ` <!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=${
process.env.GA_KEY
}" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->`,
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
......
......@@ -4,7 +4,11 @@ process.env.BABEL_ENV = 'test'
const config = require('config')
const path = require('path')
const webpack = require('webpack')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const rules = require('./rules.production')
const resolve = require('./common-resolve')
......@@ -15,20 +19,28 @@ module.exports = [
target: 'web',
context: path.join(__dirname, '..', 'app'),
entry: {
app: ['react-hot-loader/patch', 'webpack-hot-middleware/client', './app'],
app: ['./app'],
},
output: {
path: path.join(__dirname, '..', '_build', 'assets'),
filename: '[name].js',
filename: '[name].[hash].js',
publicPath: '/assets/',
},
module: {
rules,
},
resolve,
devtool: 'eval',
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new CleanWebpackPlugin(['assets'], {
root: path.join(__dirname, '..', '_build'),
}),
new HtmlWebpackPlugin({
title: 'Hindawi Review',
buildTime: new Date().toString(),
template: '../app/index-production.html',
inject: 'body',
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}),
......@@ -36,9 +48,13 @@ module.exports = [
[config.authsome.mode]: config.authsome.mode,
[config.validations]: config.validations,
}),
new ExtractTextPlugin('styles/main.css'),
new CopyWebpackPlugin([{ from: '../static' }]),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new UglifyJSPlugin({
sourceMap: true,
}),
],
node: {
fs: 'empty',
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment