This repository was archived by the owner on Jun 10, 2019. It is now read-only.
File tree 5 files changed +60
-5
lines changed
5 files changed +60
-5
lines changed Original file line number Diff line number Diff line change
1
+ COMPOSE_PROJECT_NAME = operationcodefrontend
1
2
PORT = 4000
2
3
GA_TRACKER_ID = UA-75642413-1
3
4
NODE_ENV = development
Original file line number Diff line number Diff line change 1
- language : node_js
2
- node_js :
3
- " node"
4
- cache : yarn
1
+ # Since we build and test in Docker we dont
2
+ # need node at build time
3
+ language : c
4
+
5
+ # cache: yarn
6
+ # sudo: required
7
+ #
8
+ # install: true
9
+
10
+ services :
11
+ - docker
12
+
13
+ script :
14
+ - make travis
15
+ - if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then make publish; fi
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ RUN npm install
13
13
COPY . /usr/src/app
14
14
15
15
# Build and optimize react app
16
- RUN npm run build
16
+ RUN yarn run build
17
17
18
18
EXPOSE 8080
19
19
Original file line number Diff line number Diff line change
1
+ NODE_CONTAINER := web
2
+
3
+ .PHONY : build
4
+ build :
5
+ docker-compose build
6
+
7
+ .PHONY : test
8
+ test :
9
+ docker-compose run ${NODE_CONTAINER} bash -c ' cd /usr/src/app && yarn test'
10
+
11
+ publish : build
12
+ bin/publish
13
+
14
+ travis : build test
15
+
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # Publishes the most recent web container to docker hubs repo.
4
+ # This script assumes docker push works.
5
+ # You must set up docker push on your own.
6
+
7
+ set -eu
8
+
9
+ DOCKER_REPO=" operationcode/operationcode_frontend"
10
+
11
+ ROOT_DIR=" $( dirname $0 ) /.."
12
+ cd $ROOT_DIR
13
+
14
+ PROJECT_NAME=$( grep COMPOSE_PROJECT_NAME $ROOT_DIR /.env | cut -d= -f2)
15
+
16
+ IMAGE_NAME=" ${PROJECT_NAME} _web"
17
+ IMAGE_ID=$( docker images $IMAGE_NAME :latest --format " {{.ID}}" )
18
+
19
+ if [ -n " $DOCKER_USERNAME " ]; then echo " Found username" ; fi
20
+ if [ -n " $DOCKER_PASSWORD " ]; then echo " Found password" ; fi
21
+
22
+ if [ -n " $DOCKER_USERNAME " ] && [ -n " $DOCKER_PASSWORD " ]; then
23
+ echo " Logging in using ENV creds"
24
+ docker login -u=" $DOCKER_USERNAME " -p=" $DOCKER_PASSWORD "
25
+ fi
26
+
27
+ docker tag $IMAGE_ID $DOCKER_REPO
28
+ docker push $DOCKER_REPO
You can’t perform that action at this time.
0 commit comments