An implementation of a small continous integration (CI) server which supports compiling a project, executing the automated tests of a project and notification of the CI results by setting the commit status on the repository on Github.
The CI server handles HTTP requests on Github push events. When there is a request, the CI server parses the request to extract to the url of the repository and the sha of the commit and then it runs a pipeline. The pipeline clones the repository, does a checkout, compiles the repository and tests it with Maven command. The pipeline result is notified by setting the commit status on the repository on Github and also written in a file to retrieve it later in a view of the history of the builds.
In total, we have three endpoints:
- /webhook : handle events of github and triggers the pipeline
- /history : displays an html formatted view of the history of the build
- /file/:file_name : displays the file_name (used to display logs)
This project uses Java 8. On Debian-based systems, you could use the following two command lines to install the JRE and the JDK.
sudo apt install openjdk-8-jdk
sudo apt install openjdk-8-jdk
Our dependencies are handled with Maven, see pom.xml.
We have many dependencies :
We have written unit tests for methods of:
- ContinousIntegrationServer.java in ContinousIntegrationServerTest.java
- Parser.java in ParserTest.java
- Pipeline.java in PipelineTest.java
- SavePipelineResult.java in SavePipelineResultTest.java
On Debian-based systems, you could use the following command line to install Maven.
sudo apt install maven
Then at the root folder, you can launch all tests by running
mvn test
Can can also lauch the server using the following command:
mvn compile exec:java -Dexec.mainClass="ci.ContinuousIntegrationServer"
Most of use Intellij.
You just have to import the project and select the file you want to run by right clicking on it on the folder view on the left of the window.
You can also use the built-in maven tool on the right of the window to run all tests.
All of us agreed on a guide for contribution
This is what we have achieved
-
Sara Ersson
- sendStatus()
- sendStatusTest()
- README
-
Viktor Widin
- /history endpoint
- /webhook endpoint
-
Robin Gunning
- Parsing of the github payload
- /file endpoint
- Hosting server
-
Fredrik Norrman
- SavePipelineResult object
- SavePipelineResult test
- javadoc
-
Cyril Pottiez
- runPipeline()
- write specifications
- Github merger