Skip to content
Snippets Groups Projects
Commit d28574ef authored by Martin Lowe's avatar Martin Lowe :flag_ca:
Browse files

Merge branch 'zacharysabourin/main/11' into 'main'

feat: Standardize build process

Closes #11

See merge request !20
parents 8c361dba 24de8642
No related branches found
No related tags found
1 merge request!20feat: Standardize build process
Pipeline #14039 passed
@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 | tr -d '\r' > .env
setup:;
@echo "Generating secret files from templates using environment file + variables"
@source .env && rm -f ./config/application/secret.properties && envsubst < config/application/secret.properties.sample | tr -d '\r' > config/application/secret.properties
dev-start:;
source .env && mvn compile quarkus:dev -Dconfig.secret.path=$$PWD/config/application/secret.properties
clean:;
mvn clean
compile-java: validate-spec generate-spec;
yarn run clean
compile-java: compile-test-resources;
mvn compile package
compile-java-quick: validate-spec;
compile-java-quick: compile-test-resources;
mvn compile package -Dmaven.test.skip=true
compile: clean compile-java;
compile-quick: clean compile-java-quick;
install-yarn:;
yarn install --frozen-lockfile --audit
generate-spec: install-yarn;
compile-test-resources: install-yarn;
yarn run generate-json-schema
validate-spec: install-yarn;
compile-start: compile-quick;
docker compose down
docker compose build
docker compose up
compile-start-headless: compile-quick;
docker compose down
docker compose build
docker compose up -d
start-spec: validate-spec;
start-spec: compile-test-resources;
yarn run start
generate-notice-src:;
docker run -v $(PWD)/:/project \
-v /project/node_modules \
......
# eclipsefdn-downloads-api
## Starting a development environment
## Getting Started
Requirements:
### Requirements
* Docker
* Java 11 >
......@@ -11,20 +11,62 @@ Requirements:
* make
* Running MariaDB instance
### Setup
1. In MariaDB instance, create a new database called `eclipse` as that is what is configured out of the box. The table definitions for the database can be found under `./config/mariadb/ddl.sql`.
2. Run `make pre-setup`. This command will setup a basic .env file, using some basic variables used in Eclipse development to accelerate the generation of secret files.
3. Ensure that the `.env` file properties reflect the connection settings used for the MariaDB instance and the credentials needed to access the DB created in step 1.
4. Run `make setup` to finish the setup process for this API, generating the secret file under `./config/application/secret.properties`.
5. Run `compile-start` or `make compile-start-headless`. The first option binds the docker containers to the current terminal, and ends the processes when the terminal is closed. The second option starts the docker containers as part of the daemon and persists beyond the terminal session.
The application can be checked by visiting http://localhost:8090/downloads/releases/2022-03. At this address, a return should be visible that represents the 2022-03 release of the Eclipse IDE.
The application can be checked by visiting <http://localhost:8090/downloads/releases/2022-03>. At this address, a return should be visible that represents the 2022-03 release of the Eclipse IDE.
#### Build and Start Server
```bash
make compile-start
```
You can run your application in dev mode that enables live coding using:
#### Live Coding Dev Mode
```bash
make dev-start
```
#### Generate Spec
```bash
make generate-test-resources
```
#### Running Tests
```bash
mvn test
```
#### Render a Live UI Preview of the API Spec
```bash
make start-spec
```
## Updating notice
Notice file contents were authored using the output of the Scancode-toolkit, running against the local environment. Any new packages added to the project should be evaluated before they are added to the project to ensure they are compatible with the EPL-2.0 license that this API is available under. To make use of Scancode, it will need to be [installed for Docker](https://scancode-toolkit.readthedocs.io/en/latest/getting-started/install.html#installation-via-docker), and its recommended that the [Scancode-Workbench](https://github.com/nexB/scancode-workbench) be used to evaluate the results.
\ No newline at end of file
Notice file contents were authored using the output of the Scancode-toolkit, running against the local environment. Any new packages added to the project should be evaluated before they are added to the project to ensure they are compatible with the EPL-2.0 license that this API is available under. To make use of Scancode, it will need to be [installed for Docker](https://scancode-toolkit.readthedocs.io/en/latest/getting-started/install.html#installation-via-docker), and its recommended that the [Scancode-Workbench](https://github.com/nexB/scancode-workbench) be used to evaluate the results.
## Contributing
1. [Fork](https://docs.gitlab.com/ee/user/project/repository/forking_workflow.html) the [eclipsefdn-downloads-api](https://gitlab.eclipse.org/eclipsefdn/it/api/eclipsefdn-downloads-api) repository
2. Clone repository `git clone https://gitlab.eclipse.org/[your_eclipsefdn_username]/eclipsefdn-downloads-api.git`
3. Create your feature branch: `git checkout -b my-new-feature`
4. Commit your changes: `git commit -m 'Add some feature' -s`
5. Push feature branch: `git push origin my-new-feature`
6. Submit a merge request
### Declared Project Licenses
This program and the accompanying materials are made available under the terms
of the Eclipse Public License v. 2.0 which is available at
<http://www.eclipse.org/legal/epl-2.0>.
SPDX-License-Identifier: EPL-2.0
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