Giter Club home page Giter Club logo

testingandci's Introduction

TestingAndCi

Spring boot Rest API with Jenkins and Docker integration

Table of Contents

About

A project developed in Java that solves mobility issues regarding booking a trip with separate services.

You will find all the typical classes in a rest api project like: models, services, repositories, controllers, jwt and exception handlers. Automating builds and test cases through Jenkins and hosted in docker.

The repository is controlled with Jpa due to simple functionality

Observe that JWT authentication is NOT implemented

Although it is a humble project and no where close in comparison to real life you may use it in any ways you feel contribute to your purpose.

Getting Started

You should not be needed to install any dependencies yourself due to maven integration. All the necessary dependencies are available in pom.xml. Therefore, I would advise you to build the project initially to check whether you would need anything more to be installed or not.

This project utilizes MySQL driver and is already included in pom.xml. Once again, it uses a simple JpaRepository.

You may check the application.properties file for more information regarding connection types and configuration.

Also, you should be aware of that if your build fails either in Jenkins or your IDE due to connection issues, my guess would be that you haven't started Apache and/or MySQL services in xampp

Prerequisites

XAMPP v3.3.0,
Jenkins v2.414.2
Docker v4.23.0
jdk-17.0.2

Installation

Cd your way to the location you want to install the project and do:

Clone the repository:

git clone https://github.com/divby0exc/TestingAndCi.git
Through GitHub CLI: gh repo clone divby0exc/TestingAndCi

You may then open up your IDE and search for the project in the given folder

To install xampp you may find it here:

  https://www.apachefriends.org/download.html

To install Jenkins you may find it here:

https://www.jenkins.io/download/

To install Docker you may find it here:

https://www.docker.com/

Configuration steps in Jenkins are as followed:

If you have any questions about the different fields
Jenkins have provided you with a black little question mark besides
almost every title for you to see how or what that is.

You repeat these below mentioned steps 2 times.
One is for dev environment and one is for prod environment

Branches to build is testing on dev and main for prod




1. Create an item
2. Freestyle project
3. Ok
4. Version control - Git
  Enter your repo url and eventual 
  credentials if you have a private repository
  For that you may add a token in GitHub as pwd.
5. Branches to build - change master to main as it is the new master
  you may also have testing as your branch depending on what branch
  you want jenkins to build
6. Build steps - Execute Windows batch command due to Windows host
  I have 2 commands which you may press add build-step to make
  1. ./mvnw compile
  2. ./mvnw package
7. Post-build Actions - Archive the artifacts
  Inside of filed to archive box you write "target/*.jar"
  which looks for all of  your .jar files inside of the target folder
  regardless of filename
8. Apply
9. Save  

Usage

You may visit this url after the installation and configuration is done: Here you will find the necessary endpoints in the project.

http://localhost:8080/

As described in About section this project is far from complete.

It was merely a fair try to make a mobility service according to a school assignment. Although I may continue on this project furthermore, with real api integration and such. This is not the case at the moment.

License

This project is licensed under the [MIT License] - see the LICENSE.md file for details.

Acknowledgments

Borrowed asJsonString from [https://howtodoinjava.com/spring-boot2/testing/spring-boot-mockmvc-example/]

Contact

Visit my GitHub
Contact mail

testingandci's People

Contributors

divby0exc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.