Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
urgi-is
data-discovery
Commits
f312541f
Commit
f312541f
authored
Jul 23, 2018
by
Exbrayat Cédric
Browse files
chore(build): add gitlab-ci.yml for ci
parent
ba264c35
Changes
4
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
0 → 100644
View file @
f312541f
# Image source available on https://github.com/Ninja-Squad/docker-rare
image
:
ninjasquad/docker-rare
# Disable the Gradle daemon for Continuous Integration servers as correctness
# is usually a priority over speed in CI environments. Using a fresh
# runtime for each build is more reliable since the runtime is completely
# isolated from any previous builds.
variables
:
GRADLE_OPTS
:
"
-Dorg.gradle.daemon=false"
before_script
:
-
export GRADLE_USER_HOME=`pwd`/.gradle
test
:
stage
:
test
script
:
./gradlew build
cache
:
key
:
"
$CI_COMMIT_REF_NAME"
policy
:
pull
paths
:
-
build
-
.gradle
README.md
0 → 100644
View file @
f312541f
# Rare project - Data discovery
## Setup
### Backend
The project uses Spring (5.x) for the backend,
with Spring Boot.
You need to install:
-
a recent enough JDK8
Then at the root of the application, run
`./gradlew build`
to download the dependencies.
Then run
`./gradlew bootRun`
to start the app.
### Frontend
The project uses Angular (6.x) for the frontend,
with the Angular CLI.
You need to install:
-
a recent enough NodeJS (8.11+)
-
Yarn as a package manager (see
[
here to install
](
https://yarnpkg.com/en/docs/install
)
)
Then in the
`frontend`
directory, run
`yarn`
to download the dependencies.
Then run
`yarn start`
to start the app, using the proxy conf to reroute calls to
`/api`
to the backend.
The application will be available on http://localhost:4200
## Build
To build the app, just run:
./gradlew assemble
This will build a standalone jar at
`backend/build/libs/rare.jar`
, that you can run with:
java -jar backend/build/libs/rare.jar
And the full app runs on http://localhost:8080
## CI
The
`.gitlab-ci.yml`
file describes how Gitlab is running the CI jobs.
It uses a base docker image named
`ninjasquad/docker-rare`
available on
[
DockerHub
](
https://hub.docker.com/r/ninjasquad/docker-rare/
)
and
[
Github
](
https://github.com/Ninja-Squad/docker-rare
)
.
The image is based on
`openjdk:8`
and adds a Chrome binary to let us run the frontend tests
(with a headless Chrome in
`--no-sandbox`
mode).
We install
`node`
and
`yarn`
in
`/tmp`
(this is not the case for local builds)
to avoid symbolic links issues on Docker.
You can approximate what runs on CI by executing:
docker run --rm -v "$PWD":/home/rare -w /home/rare ninjasquad/docker-rare ./gradlew build
frontend/build.gradle.kts
View file @
f312541f
...
...
@@ -3,10 +3,17 @@ plugins {
id
(
"com.moowork.node"
)
version
"1.2.0"
}
val
isCi
=
System
.
getenv
(
"CI"
)
!=
null
node
{
version
=
"8.11.3"
npmVersion
=
"6.2.0"
yarnVersion
=
"1.7.0"
if
(
isCi
)
{
// we specify a custom installation directory because of permission issues on Docker
workDir
=
file
(
"/tmp/node"
)
yarnWorkDir
=
file
(
"/tmp/yarn"
)
}
download
=
true
}
...
...
@@ -22,6 +29,7 @@ tasks {
}
val
yarn_build
by
getting
{
dependsOn
(
yarn_install
)
inputs
.
dir
(
"src"
)
outputs
.
dir
(
"dist"
)
}
...
...
frontend/src/karma.conf.js
View file @
f312541f
...
...
@@ -25,7 +25,13 @@ module.exports = function (config) {
colors
:
true
,
logLevel
:
config
.
LOG_INFO
,
autoWatch
:
true
,
browsers
:
[
'
Chrome
'
],
browsers
:
[
'
ChromeHeadlessNoSandbox
'
],
customLaunchers
:
{
ChromeHeadlessNoSandbox
:
{
base
:
'
ChromeHeadless
'
,
flags
:
[
'
--no-sandbox
'
]
// required for Gitlab CI
}
},
singleRun
:
false
});
};
\ No newline at end of file
};
Write
Preview
Markdown
is supported
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