Skip to content
Snippets Groups Projects
Commit a739b12d authored by Zachary Sabourin's avatar Zachary Sabourin Committed by Martin Lowe
Browse files

feat: Standardize build process + update readme

parent d5650c0c
No related branches found
No related tags found
1 merge request!26feat: Standardize build process + update readme
@Library('common-shared') _
@Library('common-shared') _
pipeline {
agent {
......@@ -108,6 +108,7 @@ pipeline {
container('buildcontainer') {
readTrusted 'Makefile'
readTrusted 'pom.xml'
readTrusted 'package.json'
sh 'make compile'
stash name: "target", includes: "target/**/*"
}
......@@ -120,7 +121,6 @@ pipeline {
}
steps {
readTrusted 'src/main/docker/Dockerfile.jvm'
unstash 'target'
sh '''
docker build -f src/main/docker/Dockerfile.jvm --no-cache -t ${IMAGE_NAME}:${TAG_NAME} -t ${IMAGE_NAME}:latest .
......
SHELL = /bin/bash
pre-setup:;
@echo "Creating environment file from template"
@rm -f .env && envsubst < config/.env.sample > .env
setup:;
@echo "Generating secret files from templates using environment file + variables"
......@@ -12,19 +9,18 @@ dev-start:;
clean:;
mvn clean
yarn run clean
install-yarn:;
yarn install --frozen-lockfile --audit
generate-spec: validate-spec;
compile-test-resources: install-yarn;
yarn run generate-json-schema
validate-spec: install-yarn;
compile-java: generate-spec;
compile-java: compile-test-resources;
mvn compile package
compile-java-quick: generate-spec;
compile-java-quick: compile-test-resources;
mvn compile package -Dmaven.test.skip=true
compile: clean compile-java;
......@@ -35,3 +31,16 @@ compile-start: compile-quick;
docker compose down
docker compose build
docker compose up -d
compile-java-quick-stubbed: compile-test-resources;
mvn compile package -Dmaven.test.skip=true -Declipse.cve.stubbed=true
compile-quick-stubbed: clean compile-java-quick-stubbed;
compile-start-stubbed: compile-quick-stubbed;
docker compose down
docker compose build
docker compose up -d
start-spec: compile-test-resources;
yarn run start
......@@ -14,24 +14,46 @@ This API fetches internal CVE data
### Setup
Additional setup instructions will be added as the project grows and evolves.
Before running the application, some setup is required. The initial setup of this server can be started by running the command `make setup` which will instantiate the secrets file. To finish the setup, open the secrets file and add values to the missing fields before starting the server. The missing fields are primarily parameters used in the fetching of CVE data from GitLab and GitHub. Once the setup is finished you should be able to start the server through docker or using the live coding dev-mode.
#### Build and start server
#### Build and Start Server
```bash
make compile-start
```
#### Live coding dev mode
#### Build and Start Server Using Stubbed Data
A version of the above server using stubbed data
```bash
make compile-start-stubbed
```
#### Live Coding Dev Mode
The live-coding dev mode uses stubbed data
```bash
make dev-start
```
#### Generate spec
#### Generate Spec
```bash
make generate-test-resources
```
#### Running Tests
```bash
mvn test
```
#### Render a Live UI Preview of the API Spec
```bash
make generate-spec
make start-spec
```
## Contributing
......
eclipse.google.jwt-location=$PWD/config/application/client_secrets.json
eclipse.google.cve-file-id=
eclipse.gitlab.cve-project.token=sample
eclipse.gitlab.cve-project.project-id=sample
eclipse.gitlab.cve-project.file-path=sample
eclipse.gitlab.cve-project.ref=sample
\ No newline at end of file
eclipse.gitlab.cve-project.ref=sample
eclipse.github.cve-project.token=sample
\ No newline at end of file
......@@ -5,6 +5,10 @@ services:
dockerfile: ./src/main/docker/Dockerfile.jvm
ports:
- 8090:8090
environment:
- CONFIG_SECRET_PATH=/var/run/secrets/secret.properties
volumes:
- ./config/application/secret.properties:/var/run/secrets/secret.properties
deploy:
restart_policy:
condition: on-failure
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment