-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start the build out of the new UI (#261)
* Start the build out of the new UI * Fix broken test * Fix build for new ui * Add a test so build passes * Add sonar back in * Add test coverage for ui * Add initial docs * Add doc publish action
- Loading branch information
Showing
153 changed files
with
13,090 additions
and
9,569 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: docs | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.x | ||
- run: pip install mkdocs | ||
- run: cd docs && mkdocs gh-deploy --force --clean --verbose | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Getting Started | ||
|
||
## Prerequisites | ||
|
||
* Postgres database (tested on 15.x) | ||
* Java 17+ (if building/running from source) | ||
* Node 18+ (if building/running from source) | ||
|
||
## Configuration | ||
|
||
The service component will need some configuration items set in order to run successfully. These should be set in a file | ||
named `config.yml`. The following configuration items are available: | ||
|
||
| Name | Default | Required | Description | | ||
|----------------------------|------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| database | none | yes | Database connection information (See https://www.dropwizard.io/en/stable/manual/configuration.html#database) | | ||
| jwtCacheSpec | `expireAfterWrite=60m` | yes | Configuration for the JWT tokens being generated. Default expires after 60 minutes | | ||
| jwtCookieAuth | none | no | JWT cookie configuration information (See https://github.com/dhatim/dropwizard-jwt-cookie-authentication#edit-you-apps-dropwizard-yaml-config-file) | | ||
| auditCleanup.initialDelay | 30s | no | Initial time to wait for cleanup job to start after server startup | | ||
| auditCleanup.intervalDelay | 1d | no | How often to run the cleanup job | | ||
| auditRecordsMaxRetain | 30d | no | How long audit records should be retained. | | ||
|
||
## Building and Running from Source | ||
|
||
* Clone the repo from [https://github.com/kiwiproject/champagne-service.git](https://github.com/kiwiproject/champagne-service.git) | ||
|
||
### Service side | ||
|
||
* Build the service: | ||
|
||
```shell | ||
cd service | ||
mvn package --DskipTests | ||
``` | ||
|
||
* Setup the database: | ||
|
||
```shell | ||
java -jar target/champagne-service-<version>.jar db migrate config.yml | ||
``` | ||
|
||
* Run the service: | ||
|
||
```shell | ||
java -jar target/champagne-service-<version>.jar server config.yml | ||
``` | ||
|
||
### UI side | ||
|
||
* Run the UI | ||
|
||
```shell | ||
cd ui | ||
npm run dev | ||
``` | ||
|
||
* Access the UI | ||
|
||
Open your browser and go to `http://localhost:5173` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Champagne | ||
|
||
Champagne is a service that allows you to toast successful deployments. This service will assist a project in managing builds, | ||
deployments, promotions to different environments and tracking manual deployment steps. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Environments | ||
|
||
The environments page lets a user manage a logical list of deployable environments for the overall system. | ||
|
||
![Screenshot](../img/environments.png) | ||
|
||
## Creating an environment | ||
|
||
1. Click the <img alt="add" src="../../img/add.png" width="40"/> button at the bottom of the screen | ||
2. The create new environment dialog will appear | ||
|
||
<img alt="New deployment environment dialog" src="../../img/create_environment.png" width="300"/> | ||
|
||
3. Enter the new environment name (**This is required**) | ||
4. Click Save to create the environment | ||
|
||
## Enabling/Disabling an environment | ||
|
||
Deployable environments can be enabled and disabled. This might be a better option than deleting the environment if there | ||
is historical data related to the environment that should be kept. | ||
|
||
**Heads Up!** Enabling and Disabling can only be performed by administrators of the deployable system! | ||
|
||
### Disable an environment | ||
|
||
To disable an environment, find the row with the environment to be disabled, click the <img alt="disable" src="../../img/disable.png" width="40"/> button. | ||
|
||
### Enable an environment | ||
|
||
To enable an environment, find the row with the environment to be enabled, click the <img alt="enable" src="../../img/enable.png" width="40"/> button. | ||
|
||
## Deleting an environment | ||
|
||
Deployable environments can be deleted. Beware, however, that this will also delete all information related to that | ||
deployable environment | ||
|
||
**Heads Up!** Deleting can only be performed by administrators of the deployable system! | ||
|
||
To delete an environment, find the row with the environment to be deleted and click the <img alt="delete" src="../../img/delete.png" width="40"/> button. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Host Configuration | ||
|
||
The host configuration page lets a user manage a list of deployable hosts and components for the system. | ||
|
||
![Screenshot](../img/host_config.png) | ||
|
||
## Creating a host | ||
|
||
**Heads Up!** Creating can only be performed by administrators of the deployable system! | ||
|
||
1. Click the <img alt="action" src="../../img/expand_button_action.png" width="40"/> button at the bottom of the screen | ||
2. Click the <img alt="new host" src="../../img/new_host_button.png" width="80"/> button | ||
3. The create new host dialog will appear | ||
|
||
<img alt="New host dialog" src="../../img/create_host.png" width="300"/> | ||
|
||
4. Enter the new host name (**This is required**) | ||
5. Enter any tags for the host (This is how components are linked to hosts). **After entering a tag name, type enter so that the tag gets included** | ||
6. Click Save to create the host | ||
|
||
## Deleting a host | ||
|
||
Hosts can be deleted. This will _only_ delete the host entry and will _not_ delete any of the components linked to that host. | ||
|
||
**Heads Up!** Deleting can only be performed by administrators of the deployable system! | ||
|
||
To delete a host, find the row with the host to be deleted and click the <img alt="delete" src="../../img/delete.png" width="40"/> button. | ||
|
||
## Creating a component | ||
|
||
**Heads Up!** Creating can only be performed by administrators of the deployable system! | ||
|
||
1. Click the <img alt="action" src="../../img/expand_button_action.png" width="40"/> button at the bottom of the screen | ||
2. Click the <img alt="new component" src="../../img/new_component_button.png" width="80"/> button | ||
3. The create new host dialog will appear | ||
|
||
<img alt="New component dialog" src="../../img/create_component.png" width="300"/> | ||
|
||
4. Enter the new component name (**This is required**) | ||
5. Enter the tag for the component (This is how components are linked to hosts). **This is required** | ||
6. Click Save to create the component | ||
|
||
## Deleting a component | ||
|
||
Components can be deleted. This will delete the component entry and will unlink it from every host matching the tag. | ||
|
||
**Heads Up!** Deleting can only be performed by administrators of the deployable system! | ||
|
||
To delete a component, find the row with the component to be deleted and click the <img alt="delete" src="../../img/delete.png" width="40"/> button. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
site_name: Champagne | ||
site_url: https://github.com/kiwiproject/champagne-service | ||
theme: readthedocs | ||
nav: | ||
- Overview: index.md | ||
- Getting Started: getting_started.md | ||
- User Guid: | ||
- Environments: user_guide/environments.md | ||
- Host Configuration: user_guide/host_configuration.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 12 additions & 11 deletions
23
service/src/main/java/org/kiwiproject/champagne/dao/mappers/ComponentMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
package org.kiwiproject.champagne.dao.mappers; | ||
|
||
import static org.kiwiproject.jdbc.KiwiJdbc.instantFromTimestamp; | ||
import org.jdbi.v3.core.mapper.RowMapper; | ||
import org.jdbi.v3.core.statement.StatementContext; | ||
import org.kiwiproject.champagne.model.Component; | ||
|
||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
|
||
import org.jdbi.v3.core.mapper.RowMapper; | ||
import org.jdbi.v3.core.statement.StatementContext; | ||
import org.kiwiproject.champagne.model.Component; | ||
import static org.kiwiproject.jdbc.KiwiJdbc.instantFromTimestamp; | ||
|
||
public class ComponentMapper implements RowMapper<Component> { | ||
|
||
@Override | ||
public Component map(ResultSet rs, StatementContext ctx) throws SQLException { | ||
return Component.builder() | ||
.id(rs.getLong("id")) | ||
.createdAt(instantFromTimestamp(rs, "created_at")) | ||
.updatedAt(instantFromTimestamp(rs, "updated_at")) | ||
.componentName(rs.getString("component_name")) | ||
.tag(rs.getString("tag")) | ||
.build(); | ||
.id(rs.getLong("id")) | ||
.createdAt(instantFromTimestamp(rs, "created_at")) | ||
.updatedAt(instantFromTimestamp(rs, "updated_at")) | ||
.componentName(rs.getString("component_name")) | ||
.tag(rs.getString("tag")) | ||
.deployableSystemId(rs.getLong("deployable_system_id")) | ||
.build(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.