Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
BalaSwecha
Water Cycle
Commits
bad73d8b
Commit
bad73d8b
authored
Mar 07, 2019
by
Sripath Roy Koganti
Browse files
Update .gitlab-ci.yml
parent
fd29da31
Changes
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
bad73d8b
# This file is a template, and might need editing before it works on your project.
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
# Using the node alpine image to build the React app
image
:
node:latest
# Pick zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-a-service
services
:
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
# Announce the URL as per CRA docs
# https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#advanced-configuration
variables
:
PUBLIC_URL
:
/water-cycle
# Cache node modules - speeds up future builds
cache
:
paths
:
-
node_modules
/
-
node_modules
test_async
:
script
:
-
npm install
-
npm start
-
node ./specs/start.js ./specs/async.spec.js
# Name the stages involved in the pipeline
stages
:
-
deploy
test_db
:
# Job name for gitlab to recognise this results in assets for Gitlab Pages
# https://docs.gitlab.com/ee/user/project/pages/introduction.html#gitlab-pages-requirements
pages
:
stage
:
deploy
script
:
-
npm install
-
node ./specs/start.js ./specs/db-postgres.spec.js
-
npm install
# Install all dependencies
-
npm run build --prod
# Build for prod
-
cp public/index.html public/404.html
# Not necessary, but helps with https://medium.com/@pshrmn/demystifying-single-page-applications-3068d0555d46
-
mv public _public
# CRA and gitlab pages both use the public folder. Only do this in a build pipeline.
-
mv build public
# Move build files to public dir for Gitlab Pages
artifacts
:
paths
:
-
public
# The built files for Gitlab Pages to serve
only
:
-
master
# Only run on master branch
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment