diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1dac532..dafaf03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,10 +7,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: "Maven Cache" - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.m2/repository key: ${{ runner.os }}-cache-maven-${{ hashFiles('**/pom.xml') }} diff --git a/.gitignore b/.gitignore index fae313f..4faeb8c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,70 @@ -.apt_generated/ -target/ -.DS_Store +### Git ### +!.gitkeep + + +### STS ### +.apt_generated .classpath .factorypath .project .settings .springBeans -bin/ +.sts4-cache + + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ + +/.nb-gradle/ + + +### VS Code ### +.vscode/ + +dump.rdb + + +### OS Specific ### +.DS_Store +.tmp/ + +tmp/ + + +### Maven ### logs/ +target/ + +.classpth +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar +.project + +buildNumber.properties +dependency-reduced-pom.xml +pom.xml.next +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +release.properties + + +### Weaver ### +dist/ + + +### Project Specific ### +.env* + +!**/src/main/** +!**/src/test/** diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0c9ea33 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,65 @@ + +# Contributing to Library Service Status System Service + +Though *Library Service Status System Service* is developed and maintained by Texas A&M University Libraries, we welcome community contributions. +Involvement in *Library Service Status System Service* can take many forms. + +
(back to top)
+ + +## Using + +Deploying *Library Service Status System Service* and trying it out at your own institution is itself a way of contributing to the development process. +For more information on deployment strategies please see the [Deployment Guide][deployment-guide]. + +
(back to top)
+ + +## Filing Issues + +Once you are using *Library Service Status System Service* the creation of new issues through GitHub is a major method of contribution towards *Library Service Status System Service* development. +Issues can be motivated by the discovery of a bug in the software, or by the desire to see either new features added or see changes to existing features. + +There are two primary types of issues: +1. Bug Report +2. Feature Request + +A **Bug Report** involves a problem with the existing software or a **Feature** is not working as designed or expected. + +A **Feature** involves new functionality or behavior. + +
(back to top)
+ + +## Creating a Pull Request + +Community code and documentation contributions are welcome and should take the form of a **GitHub Pull Request** (*PR*). +Each *PR* will need to be reviewed by a *Library Service Status System Service* developer. +A review will result in the *PR* being accepted and merged, a descriptive request for changes, or the *PR* being closed along with a detailed explanation. + +It is our intention to maintain labeling on issues that are deemed to be low difficulty in order to provide a good point of entry for those looking to begin contributing code or documentation. + +A *PR* description should include a list of the specific issues resolved, the predicted *semantic versioning* impact of the changes, and a description which characterizes the nature of the changes made. +When creating a *PR*, an issue template is automatically provided to simplify this process. + +For more information about *semantic versioning* please see [Semantic Versioning Website][semantic-versioning]. +In general keep in mind: + +- A **Major Change** is a breaking change that is not backwards compatible. +- A **Minor Change** is a non-breaking change that is backwards compatible to the last **Major Change**. +- A **Patch** is a trivial change or bug fix that should not impact compatibility. + +
(back to top)
+ + +## Good Luck! + +We look forward to seeing your contributions. +If you have any additional questions please contact the *Library Service Status System Service* developers at helpdesk@library.tamu.edu. + +
(back to top)
+ + + +[deployment-guide]: DEPLOYING.md +[semantic-versioning]: https://semver.org/ diff --git a/DEPLOYING.md b/DEPLOYING.md new file mode 100644 index 0000000..52db491 --- /dev/null +++ b/DEPLOYING.md @@ -0,0 +1,67 @@ + +# Library Service Status System Service Deployment Guide + +## Production Deployments + +For **production** deployments, deploy using `docker-compose` via the [LSSS App Repo][app-repo]. +This is the recommended method of deployment for production systems. +Go to the [LSSS App Repo][app-repo] and following the deployment instructions there. + +Performing the deployment using the [LSSS App Repo][app-repo] should be something similar to the following: +```shell +docker-compose up +``` + +The **development** deployment can also use `docker-compose` in the same way. + +
(back to top)
+ + +## Development Deployment using Docker + +To manually use `docker` rather than `docker-compose`, run the following: + +```shell +docker image build -t lsssservice . +docker run -it lsssservice +``` + +_* Note: `-t lsssservice` and `-it lsssservice` may be changed to another tag name as desired, such as `-t developing_on_this` and `-it developing_on_this`._
+ +
(back to top)
+ + +## Development Deployment using Maven + +Manual deployment can be summed up by running: + +```shell +mvn spring-boot:run +``` + +Those steps are a great way to start but they also fail to explain the customization that is often needed. +There are multiple ways to further configure this for deployment to better meet the desired requirements. + +It is highly recommended only to perform *manual installation* when developing. +For **production** deployment, please use `docker-compose` via the [LSSS App Repo][app-repo] or use the **Docker** method above. + +
(back to top)
+ + +### Directly Configuring the `src/main/resources/application.yml` File + +This method of configuration works by altering the configuration file. + +With this in mind, the deployment steps now look like: + +```shell +# Edit 'src/main/resources/application.yml' here. + +mvn spring-boot:run +``` + +
(back to top)
+ + + +[app-repo]: https://github.com/TAMULib/LibraryServiceStatusSystem diff --git a/Dockerfile b/Dockerfile index b217214..381780c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,27 @@ # Settings. ARG USER_ID=3001 ARG USER_NAME=lsss -ARG HOME_DIR=/$USER_NAME -ARG SOURCE_DIR=$HOME_DIR/source +ARG SOURCE_DIR=/$USER_NAME/source # Maven stage. FROM maven:3-openjdk-11-slim as maven ARG USER_ID ARG USER_NAME -ARG HOME_DIR ARG SOURCE_DIR -# Create the group (use a high ID to attempt to avoid conflits). -RUN groupadd -g $USER_ID $USER_NAME +# Create the user and group (use a high ID to attempt to avoid conflicts). +RUN groupadd --non-unique -g $USER_ID $USER_NAME && \ + useradd --non-unique -d /$USER_NAME -m -u $USER_ID -g $USER_ID $USER_NAME -# Create the user (use a high ID to attempt to avoid conflits). -RUN useradd -d $HOME_DIR -m -u $USER_ID -g $USER_ID $USER_NAME +# Update the system and install dependencies. +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* -# Update the system. -RUN apt-get update && apt-get upgrade -y +# Make sure source directory exists. +RUN mkdir -p $SOURCE_DIR && \ + chown -R $USER_ID:$USER_ID $SOURCE_DIR # Set deployment directory. WORKDIR $SOURCE_DIR @@ -40,24 +43,20 @@ RUN mvn package -Pjar -DskipTests=true FROM openjdk:11-jre-slim ARG USER_ID ARG USER_NAME -ARG HOME_DIR ARG SOURCE_DIR -# Create the group (use a high ID to attempt to avoid conflits). -RUN groupadd -g $USER_ID $USER_NAME - -# Create the user (use a high ID to attempt to avoid conflits). -RUN useradd -d $HOME_DIR -m -u $USER_ID -g $USER_ID $USER_NAME +# Create the user and group (use a high ID to attempt to avoid conflicts). +RUN groupadd --non-unique -g $USER_ID $USER_NAME && \ + useradd --non-unique -d /$USER_NAME -m -u $USER_ID -g $USER_ID $USER_NAME # Login as user. USER $USER_NAME # Set deployment directory. -WORKDIR $HOME_DIR +WORKDIR /$USER_NAME # Copy over the built artifact from the maven image. COPY --from=maven $SOURCE_DIR/target/ROOT.jar ./lsss.jar - # Run java command. CMD ["java", "-jar", "./lsss.jar"] diff --git a/LICENSE b/LICENSE index c26318f..9d02011 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,8 @@ -Copyright (c) 2016 Texas A&M University Libraries +The MIT License (MIT) +Copyright © 2022 Texas A&M University Libraries -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index d2c0f15..67c9ff0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,61 @@ -[![Build Status](https://github.com/TAMULib/LibraryServiceStatusSystemService/workflows/Build/badge.svg)](https://github.com/TAMULib/LibraryServiceStatusSystemService/actions?query=workflow%3ABuild) -[![Coverage Status](https://coveralls.io/repos/github/TAMULib/LibraryServiceStatusSystemService/badge.svg)](https://coveralls.io/github/TAMULib/LibraryServiceStatusSystemService) +[![Build Status][build-badge]][build-status] +[![Coverage Status][coverage-badge]][coverage-status] # Library Service Status System -A Spring Boot service that allows management and notification of Library System Status. +A *Spring* backend for the *Library Service Status System (LSSS) Service* developed and maintained by [Texas A&M University Libraries][tamu-library]. + +This is a service for managing *Library Services*. + +
+Table of contents + + - [Deployment](#deployment) + - [Developer Documentation](#developer-documentation) + - [Additional Resources](#additional-resources) + +
+ + +## Deployment + +For a quick and easy deployment using `docker-compose` consider using the [Library Service Status System App Repo][app-repo]. + +For _advanced use cases_, or when `docker-compose` is unavailable, the UI may be either started using `docker` directly or even manually started. +This process is further described in the [Deployment Guide][deployment-guide]. + +
(back to top)
+ + +## Developer Documentation + +- [Contributors Documentation][contribute-guide] +- [Deployment Documentation][deployment-guide] +- [API Documentation][api-documentation] + +
(back to top)
+ + +## Additional Resources + +Please feel free to file any issues concerning Library Service Status System Service to the issues section of the repository. + +Any questions concerning Library Service Status System Service can be directed to helpdesk@library.tamu.edu. + +Copyright © 2022 Texas A&M University Libraries under the [MIT License][license]. + +
(back to top)
+ + + +[app-repo]: https://github.com/TAMULib/LibraryServiceStatusSystem +[build-badge]: https://github.com/TAMULib/LibraryServiceStatusSystemService/workflows/Build/badge.svg +[build-status]: https://github.com/TAMULib/LibraryServiceStatusSystemService/actions?query=workflow%3ABuild +[coverage-badge]: https://coveralls.io/repos/github/TAMULib/LibraryServiceStatusSystemService/badge.svg +[coverage-status]: https://coveralls.io/github/TAMULib/LibraryServiceStatusSystemService + +[api-documentation]: https://tamulib.github.io/LibraryServiceStatusSystemService +[tamu-library]: http://library.tamu.edu +[deployment-guide]: DEPLOYING.md +[contribute-guide]: CONTRIBUTING.md +[license]: LICENSE diff --git a/pom.xml b/pom.xml index 9768e37..4222b58 100644 --- a/pom.xml +++ b/pom.xml @@ -1,17 +1,20 @@ - - 4.0.0 + edu.tamu status-system 1.4.4 + Library-Service-Status-System + A System for monitoring and reporting the status of Library Services edu.tamu.weaver webservice-parent - 2.1.1-RC10 + 2.1.1-RC11 @@ -105,7 +108,7 @@ - + ROOT @@ -207,14 +210,22 @@ tamu-releases https://artifacts.library.tamu.edu/repository/maven-releases - true - false + + true + + + false + tamu-snapshots https://artifacts.library.tamu.edu/repository/maven-snapshots - false - true + + false + + + true + diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties deleted file mode 100644 index e8f3be4..0000000 --- a/src/main/resources/log4j.properties +++ /dev/null @@ -1,17 +0,0 @@ -# Root logger option -log4j.rootLogger=DEBUG, stdout, file - -# Redirect log messages to console -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.Target=logger.info -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n - -# Redirect log messages to a log file -log4j.appender.file=org.apache.log4j.RollingFileAppender -#outputs to Tomcat home -log4j.appender.file.File=${catalina.home}/logs/myapp.log -log4j.appender.file.MaxFileSize=5MB -log4j.appender.file.MaxBackupIndex=10 -log4j.appender.file.layout=org.apache.log4j.PatternLayout -log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n \ No newline at end of file diff --git a/src/test/resources/log4j.properties b/src/test/resources/log4j.properties deleted file mode 100644 index e8f3be4..0000000 --- a/src/test/resources/log4j.properties +++ /dev/null @@ -1,17 +0,0 @@ -# Root logger option -log4j.rootLogger=DEBUG, stdout, file - -# Redirect log messages to console -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.Target=logger.info -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n - -# Redirect log messages to a log file -log4j.appender.file=org.apache.log4j.RollingFileAppender -#outputs to Tomcat home -log4j.appender.file.File=${catalina.home}/logs/myapp.log -log4j.appender.file.MaxFileSize=5MB -log4j.appender.file.MaxBackupIndex=10 -log4j.appender.file.layout=org.apache.log4j.PatternLayout -log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n \ No newline at end of file