- Cloud Jenkins Server (Will be provided by NUS ISS)
- Github Account (https://github.com/)
- Launch internet browser, navigate to the link below. Login using the credential provided as below:-
- Jenkins Server (AWS) - Take note do use your own AWS jenkins server
- url : http://
<your aws public ip>
/jenkins/
- url : http://
- Fork the following git repository https://github.com/kenken64/StackAnnotation to your own Github Account
- Clone the codes down to your local working directory. Replace
<your username>
with your own Github username.
git clone https://github.com/<your username>/StackAnnotation
- Go to Jenkins, configure a new freestyle job as per the screenshot. Name your job item as "StackAnnotation_your initial"
-
Enter task description as 'This is a StackAnnotation ant build'
-
Tick the Github Project option then enter the url as
<your StackAnnotation github repo url>
- Under source code management, select Git then enter the repository URL as
<your StackAnnotation github repo url>
. Change the branch to be build to '*/development'
- Configure poll interval for the source code retrieval to be used as new build. Check Github hook trigger for GITScm polling and polling SCM. Configure the polling schedule as * * * * * (Polling every minute, feel free to change to your desire scheduling timing)
- Configure the pre build step, add invoke ant step then select Ant version as 'Ant' follow by targets as build
- Before configure this step. Run the build manually with the step 8 configured and saved. Once the manual trigger build is successful proceed with configure the post build action where it will generate Junit published report from the ant build
- The build will trigger automatically
11. Lets make changes to the test case and invalidate the build. the build on jenkins will fail. Under the file test/test/MyStringStackTest.java under the testPush method right after the instantiation of the MyStringStack class. Before making changes to the test case, kindly checkout to the development branch within the project working directory
$ cd StackAnnotation
$ git checkout development
MyStringStack stack = new MyStringStack();
stack.push (s1);
assertTrue (stack.isEmpty());
- Commit the changes to the github.
git add .
git commit -m "fail the test case"
git push origin development
- The outcome of the build will be unstable
- Fork the following git repository https://github.com/kenken64/StackAnnotationMaven.git to your own Github Account
- Clone the codes down to your local working directory. Replace
<your username>
with your own Github username.
git clone https://github.com/<your username>/StackAnnotationMaven.git
Change directory to the working directory and switch to the development branch
cd StackAnnotationMaven
git checkout development
- Go to Jenkins, configure a new freestyle job as per the screenshot. Name your job item as "StackAnnotationMaven_your initial"
-
Enter task description as 'This is a StackAnnotation Maven build'
-
Tick the Github Project option then enter the url as
<your StackAnnotationMaven github repo url>
- Under source code management, select Git then enter the repository URL as 'your StackAnnotationMaven github repo url'. Change the branch to be build to '*/development'
- Check the poll interval for the source code retrieval to be used as new build. Check Github hook trigger for GITScm polling and polling SCM. Configure the polling schedule as * * * * * (Polling every minute, feel free to change to your desire scheduling timing)
- Configure the pre build step, add top-level Maven step then select Maven version as 'Maven' follow by entering goals as surefire-report:report. Refer to https://maven.apache.org/surefire/maven-surefire-report-plugin/usage.html
- Lastly, configure the post build action where it will generate Junit published report from the maven build. Enter 'target/surefire-reports/TEST-sg.edu.nus.StackAnnotation.AppTest.xml' to the test report XML field.
- The build will trigger automatically
- Before making changes to the code switch to the development branch. Lets make changes to the test case and invalidate the build. Under the file AppTest.java line 18 change the code to as below
assertTrue( false );
- Commit the changes to the github.
git add .
git commit -m "fail the test case"
git push origin development
- The outcome of the build will be unstable. Status of the build will be flag out as amber.