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/
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
- fork this git repository by clicking on "Fork" in the top right corner
- see the content of the file .github/workflows/test.yml that controls the test CI workflow
- edit the file src/main/java/cz/muni/pa160/ChatService.java by clicking the pencil icon
- comment out the third line with
import org.slf4j.Logger;
and commit the change - visit the Actions page and check that the two builds have failed, the badge in README is now red
- edit the file again, uncomment the line and commit the change
- visit the Actions page and check that the two builds are passing
- the badge becomes green again, if not, press CTRL+SHIFT+R to reload its image
- see the content of the file .github/workflows/release_assets.yml that controls the CD workflow
- visit the [Releases] page and click on Draft a new release
- Type a tag name into the Tag version form field and a title into Release title
- click Publish release
- visit the Actions page to see how the workflow is executed
- after it finishes, visit the Releases page to see the created JAR file