Skip to content

LogicStuff/muni-pa160-chat-service

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

muni-pa160-chat-service

Example of a web service with OpenAPI description in openapi.yml

Prerequisites: git, Apache Maven and JDK 11+

Download and compile:

git clone https://github.com/martin-kuba/muni-pa160-chat-service.git
cd muni-pa160-chat-service
mvn spring-boot:run

Alternatively, you can create an executable JAR file and execute it:

mvn clean install
java -jar target/pa160_chat_service.jar

Then visit the service with your browser: http://localhost:8080/

Running the chat service with TLS

Create a PKCS12 keystore with:

openssl pkcs12 -export -name "mycert" -inkey key.pem -in cert.pem -certfile chain.pem -out mykeystore.p12

then run with the following options:

java -jar target/pa160_chat_service.jar \
     --server.port=8443 \
     --server.ssl.key-store-type=pkcs12 \
     --server.ssl.key-store=mykeystore.p12 \
     --server.ssl.key-store-password=password

CI/CD experiments

Continuous integration

  1. fork this git repository by clicking on "Fork" in the top right corner
  2. see the content of the file .github/workflows/test.yml that controls the test CI workflow
  3. edit the file src/main/java/cz/muni/pa160/ChatService.java by clicking the pencil icon
  4. comment out the third line with import org.slf4j.Logger; and commit the change
  5. visit the Actions page and check that the two builds have failed, the badge in README is now red
  6. edit the file again, uncomment the line and commit the change
  7. visit the Actions page and check that the two builds are passing
  8. the badge becomes green again, if not, press CTRL+SHIFT+R to reload its image

Continuous delivery

  1. see the content of the file .github/workflows/release_assets.yml that controls the CD workflow
  2. visit the [Releases] page and click on Draft a new release
  3. Type a tag name into the Tag version form field and a title into Release title
  4. click Publish release
  5. visit the Actions page to see how the workflow is executed
  6. after it finishes, visit the Releases page to see the created JAR file

About

Example of a web service with OpenAPI description

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 69.2%
  • HTML 30.8%