diff --git a/.travis.yml b/.travis.yml index 0ccbdc46..8e30656a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,22 +27,8 @@ before_install: # Install truffle - yarn global add truffle script: - - yarn build + - bash ./config/travis/build.sh after_success: - - | - - if [ ${TRAVIS_BRANCH} = "master" ]; then - export NODE_ENV=production; - else - export NODE_ENV=development; - fi - - | - - if [[ -n "$TRAVIS_TAG" ]]; then - export PRODUCTION_DEPLOYMENT=true; - export REACT_APP_ENV='production'; - fi - - yarn build # Pull Request - Deploy it to a review environment # Travis doesn't do deploy step with pull requests builds - ./config/travis/deploy_pull_request.sh @@ -68,7 +54,7 @@ deploy: secret_access_key: $AWS_SECRET_ACCESS_KEY skip_cleanup: true local_dir: build_webpack - upload-dir: current + upload-dir: current/app on: branch: master diff --git a/config/travis/build.sh b/config/travis/build.sh new file mode 100644 index 00000000..0b6ca78a --- /dev/null +++ b/config/travis/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +export NODE_ENV=production; + +if [[ -n "$TRAVIS_TAG" ]]; then export REACT_APP_ENV='production'; fi + +yarn lint:check +yarn prettier:check +yarn build \ No newline at end of file diff --git a/config/travis/deploy_pull_request.sh b/config/travis/deploy_pull_request.sh index 9941f825..fa285678 100755 --- a/config/travis/deploy_pull_request.sh +++ b/config/travis/deploy_pull_request.sh @@ -15,11 +15,11 @@ function deploy_pull_request { REVIEW_FEATURE_FOLDER="$REPO_NAME_ALPHANUMERIC/$PULL_REQUEST_NAME" # Deploy safe-team project - aws s3 sync build_webpack s3://${REVIEW_BUCKET_NAME}/${REVIEW_FEATURE_FOLDER} --delete + aws s3 sync build_webpack s3://${REVIEW_BUCKET_NAME}/${REVIEW_FEATURE_FOLDER}/app --delete } function publish_pull_request_urls_in_github { - REVIEW_FEATURE_URL="https://$PULL_REQUEST_NAME--$REPO_NAME_ALPHANUMERIC.$REVIEW_ENVIRONMENT_DOMAIN" + REVIEW_FEATURE_URL="https://$PULL_REQUEST_NAME--$REPO_NAME_ALPHANUMERIC.$REVIEW_ENVIRONMENT_DOMAIN/app" # Using the Issues api instead of the PR api # Done so because every PR is an issue, and the issues api allows to post general comments, diff --git a/config/travis/deploy_release.sh b/config/travis/deploy_release.sh index b6991e51..6c6c7069 100755 --- a/config/travis/deploy_release.sh +++ b/config/travis/deploy_release.sh @@ -18,5 +18,5 @@ then REVIEW_RELEASE_FOLDER="$REPO_NAME_ALPHANUMERIC/$TRAVIS_TAG_ALPHANUMERIC" # Deploy safe-team release project - aws s3 sync build_webpack s3://${REVIEW_BUCKET_NAME}/${REVIEW_RELEASE_FOLDER} --delete + aws s3 sync build_webpack s3://${REVIEW_BUCKET_NAME}/${REVIEW_RELEASE_FOLDER}/app --delete fi diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 45748239..d7a7f957 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -54,7 +54,7 @@ function ensureSlash(path, needsSlash) { // like /todos/42/static/js/bundle.7289d.js. We have to know the root. const homepagePath = require(paths.appPackageJson).homepage // var homepagePathname = homepagePath ? url.parse(homepagePath).pathname : '/'; -const homepagePathname = process.env.PRODUCTION_DEPLOYMENT ? "/app/" : "/" +const homepagePathname = "/app/" // Webpack uses `publicPath` to determine where the app is being served from. // It requires a trailing slash, or the file assets will get an incorrect path. const publicPath = ensureSlash(homepagePathname, true) diff --git a/src/routes/safe/components/Layout.jsx b/src/routes/safe/components/Layout.jsx index cf3d6e1c..ebf5ce4d 100644 --- a/src/routes/safe/components/Layout.jsx +++ b/src/routes/safe/components/Layout.jsx @@ -166,7 +166,7 @@ const Layout = (props: Props) => { Apps ) - + const labelSettings = ( <> diff --git a/src/routes/safe/components/Settings/index.jsx b/src/routes/safe/components/Settings/index.jsx index fca92bf0..e0965129 100644 --- a/src/routes/safe/components/Settings/index.jsx +++ b/src/routes/safe/components/Settings/index.jsx @@ -143,7 +143,13 @@ class Settings extends React.Component { onClick={this.handleChange(1)} > - + Safe details diff --git a/src/store/index.js b/src/store/index.js index de2ac72f..503b79c1 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -34,7 +34,7 @@ import currentSession, { type State as CurrentSessionState, } from '~/logic/currentSession/store/reducer/currentSession' -export const history = createBrowserHistory() +export const history = createBrowserHistory({ basename: '/app/' }) // eslint-disable-next-line const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose diff --git a/yarn.lock b/yarn.lock index 574c18ea..cf60830d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17487,6 +17487,7 @@ websocket@1.0.29, "websocket@github:web3-js/WebSocket-Node#polyfill/globalThis": dependencies: debug "^2.2.0" es5-ext "^0.10.50" + gulp "^4.0.2" nan "^2.14.0" typedarray-to-buffer "^3.1.5" yaeti "^0.0.6"