Web application to host p2 repositories backed by AWS S3.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
What things you need to install the software and how to install them
- Maven 3.5.x
- Java 1.8+
Package the self-contained JAR:
$ mvn clean package
Run the JAR:
$ java -jar aws-p2-repository-webapp/target/aws-p2-repository-webapp-<version>.jar
To view, open a web browser and navigate to localhost:<port>/browse
.
$ docker build --tag aws-p2-repository .
To execute all unit tests and perform code coverage analysis, run the following from the root of the project:
$ mvn clean verify
The JAR produced in /aws-p2-repository-webapp/target
is self-contained, and can be deployed as a stand-alone JAR file. Alternatively, it can be deployed via a Docker container.
AWS_ACCESS_KEY_ID
- See Working with AWS CredentialsAWS_SECRET_KEY
- See Working with AWS CredentialsAWS_S3_BUCKET_NAME
- The name of the AWS S3 bucket where the p2 repositories are storedAWS_P2_REPO_WEBAPP_BRAND_NAME
- Custom website name brandingAWS_P2_REPO_WEBAPP_BRAND_ICON
- URL of the branding icon to useAWS_P2_REPO_WEBAPP_BRAND_FAVICON
- URL of the branding favicon to useAWS_P2_REPO_WEBAPP_CUSTOM_DOMAIN
- The welcome message to display on the dashboardPORT
- The port number that the embedded server will useP2_INSPECTOR_BASE_URL
- The base URL of the p2 Inspector to retrieve p2 repository metadata
Due to the number of required environment variables, you can use a config file containing the environment variables.
$ docker run --rm -d -p 8081:8081 --env-file ./env.list aws-p2-repository
Example env.list
file:
AWS_ACCESS_KEY_ID=FAKENOTREAL123
AWS_SECRET_KEY=FAKENOTREAL123
AWS_S3_BUCKET_NAME=p2.example.com
AWS_P2_REPO_WEBAPP_BRAND_NAME=p2.example.com
AWS_P2_REPO_WEBAPP_BRAND_ICON=https://www.example.com/icon.png
AWS_P2_REPO_WEBAPP_BRAND_FAVICON=https://www.example.com/favicon.png
AWS_P2_REPO_WEBAPP_CUSTOM_DOMAIN=p2.example.com
P2_INSPECTOR_BASE_URL=https://inspector.example.com
PORT=8081
The application expects that bucket content follows the following layout in the root of the bucket:
{project_name}/{snapshots|releases}/{version}/
For example:
+ foo-project
+ snapshots
| + 1.0.0-SNAPSHOT
| | + features
| | | + ...
| | + plugins
| | | + ...
| | + artifacts.jar
| | + artifacts.xml.xz
| | + content.jar
| | + content.xml.xz
| | + p2.index
| + 1.1.0-SNAPSHOT
| + ...
+ releases
+ 1.0.0
+ ...
- Spring Boot - The web application framework
- Maven - Dependency Management
- Docker - Containerized deployment
We use SemVer for versioning. For the versions available, see the tags on this repository.
This project is licensed under the MIT License - see the LICENSE file for details