From 8e7c8dedc01b9e937b5bdea00ca983e1b845ed65 Mon Sep 17 00:00:00 2001 From: zhuojie Date: Fri, 31 May 2019 15:17:24 -0700 Subject: [PATCH] Fix relative path --- .circleci/config.yml | 9 +++++---- Dockerfile | 18 +++++++++--------- browser/flagr-ui/.env | 3 +++ browser/flagr-ui/.env.development | 1 - browser/flagr-ui/.env.production | 2 +- browser/flagr-ui/vue.config.js | 3 +++ 6 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 browser/flagr-ui/.env delete mode 100644 browser/flagr-ui/.env.development create mode 100644 browser/flagr-ui/vue.config.js diff --git a/.circleci/config.yml b/.circleci/config.yml index ccf6d21b..2be401d4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,17 +9,19 @@ jobs: working_directory: /go/src/github.com/checkr/flagr steps: - checkout + - run: apt update && apt install -y sqlite3 - run: make deps - run: make ci - run: bash <(curl -s https://codecov.io/bash) - ui_test: + ui_lint: docker: - image: node:10 working_directory: /go/src/github.com/checkr/flagr steps: - checkout - - run: cd browser/flagr-ui && npm install && npm test + - run: cd browser/flagr-ui && npm install + - run: cd browser/flagr-ui && npm run lint integration_test: docker: @@ -29,7 +31,6 @@ jobs: - setup_remote_docker: version: 18.06.0-ce docker_layer_caching: true - - run: docker pull checkr/flagr-ci:go1.12 - run: cd integration_tests && make build-image - run: cd integration_tests && make down - run: cd integration_tests && make up @@ -40,5 +41,5 @@ workflows: test: jobs: - unit_test - - ui_test + - ui_lint - integration_test diff --git a/Dockerfile b/Dockerfile index bae3d284..be39f441 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,21 @@ -###################################### -# Prepare go_builder -###################################### -FROM golang:1.12 as go_builder -WORKDIR /go/src/github.com/checkr/flagr -ADD . . -RUN make build - ###################################### # Prepare npm_builder ###################################### FROM node:10 as npm_builder WORKDIR /go/src/github.com/checkr/flagr -ADD ./browser ./browser +ADD . . ARG FLAGR_UI_POSSIBLE_ENTITY_TYPES=null ENV VUE_APP_FLAGR_UI_POSSIBLE_ENTITY_TYPES ${FLAGR_UI_POSSIBLE_ENTITY_TYPES} RUN make build_ui +###################################### +# Prepare go_builder +###################################### +FROM golang:1.12 as go_builder +WORKDIR /go/src/github.com/checkr/flagr +ADD . . +RUN make build + ###################################### # Copy from builder to alpine image ###################################### diff --git a/browser/flagr-ui/.env b/browser/flagr-ui/.env new file mode 100644 index 00000000..4f901f0c --- /dev/null +++ b/browser/flagr-ui/.env @@ -0,0 +1,3 @@ +BASE_URL="" +VUE_APP_API_URL=http://127.0.0.1:18000/api/v1 +VUE_APP_FLAGR_UI_POSSIBLE_ENTITY_TYPES=null diff --git a/browser/flagr-ui/.env.development b/browser/flagr-ui/.env.development deleted file mode 100644 index ec9bb371..00000000 --- a/browser/flagr-ui/.env.development +++ /dev/null @@ -1 +0,0 @@ -VUE_APP_API_URL="http://127.0.0.1:18000/api/v1" diff --git a/browser/flagr-ui/.env.production b/browser/flagr-ui/.env.production index 26fac452..e0cb1c3e 100644 --- a/browser/flagr-ui/.env.production +++ b/browser/flagr-ui/.env.production @@ -1 +1 @@ -VUE_APP_API_URL="/api/v1" +VUE_APP_API_URL=api/v1 diff --git a/browser/flagr-ui/vue.config.js b/browser/flagr-ui/vue.config.js new file mode 100644 index 00000000..1efa72c8 --- /dev/null +++ b/browser/flagr-ui/vue.config.js @@ -0,0 +1,3 @@ +module.exports = { + publicPath: process.env.BASE_URL +}