Please follow these instructions carefully to set up a new exercise for the students in your course. The instructions demonstrate setting up a Java exercise, however this can be adapted to any programming language supported by the build server.
Requirements: Apache Maven, Git
-
Create a new Maven project, e.g. using the following command (insert your own group ID and exercise name):
mvn -B archetype:generate \ -DarchetypeGroupId=org.apache.maven.archetypes \ -DgroupId=de.tum.cs.i1.pse2016 \ -DartifactId=exercisename
-
Configure the Maven project:
- Add your dependencies to
pom.xml
- Set compiler level to Java 8 in
pom.xml
.
- Add your dependencies to
-
Add your code:
- Add the assignment code to
src/main/java/
. - Add the testing code to
src/test/java/
. - Add testing resources to
src/test/resources
.
- Add the assignment code to
-
Initialize the Git repositories:
git init
in exercise root folder.- Add
src/test/*
to the repository’s.gitignore
. git init
insrc/test
.- Add and commit files.
You will need to create a unique Bitbucket project per exercise.
- Choose an appropriate project name and project key, e.g. for the exercise "State Chart" in the course "Introduction to Software Engineering (Summer 2016)" a suitable project key would be
EIST16SC
. - Give the user artemis admin permissions on the project.
- Inside the project, create two repositories:
- Assignment repository containing the exercise code for the students. Since this repository contains no reference to the Bitbucket project outside of the Bitbucket UI, we recommend to name this repository with the project key and to append
exercise
, e.g.EIST16SC-exercise
. Add this repository as a remote for your local exercise repository and push. - Test Repository containing the testing code. We recommend to use the project key and append
test
, e.g.EIST16SC-test
. Add this repository as a remote for your local exercise’s test repository and push.
- Assignment repository containing the exercise code for the students. Since this repository contains no reference to the Bitbucket project outside of the Bitbucket UI, we recommend to name this repository with the project key and to append
- Create a new plan:
- Choose to create it inside a new project. Preferably you should use the same project key as in Bitbucket.
- Give the plan a descriptive key such as "BASE". The plan name and description are not important.
- Choose an arbitrary linked repository (Will be deleted later on since we do not use linked repositories).
- Click "Configure plan".
- Click "Create" (Setup will be completed in next step).
- Configure the plan (
Open plan
->Actions
->Configure plan
):- Permissions: Remove the View permission for logged in and anonymous users. Add admin permissions for the user artemis.
- Repositories:
- Remove the repository which was linked during the initial setup.
- Click "Add repository".
- Add the exercise code repository. Important: Give it the name “Assignment”.
- Add the test repository. Here, an arbitrary name can be chosen.
- Stages:
-
Choose the default job in the default stage.
-
Edit the source code checkout task: Add the exercise code repository (make sure it points to the repository and not to the default repository) and the test repository (set the checkout directory so it is checked out into
src/test/
). -
Add a Maven 3.x task with goal
clean test
. Check "This build will produce test results". Other settings might depend on your specific code setup. -
Add a script task with the following (inline) content:
curl -k -X POST https://artemis.ase.in.tum.de/api/results/${bamboo.planKey}
-
Optional: Add a requirement "AgentType equals Amazon" to the job if it should only be built on remote build agents.
-
-
If you have not created a course yet, ask one of the admins to create one.
-
Create a new exercise (
Course Administration
->Course
->Create a new Exercise
) with the following parameters:- Title: A descriptive title for the exercise
- Base Repository URL: The URL of the repository containing the exercise code (e.g. https://repobruegge.in.tum.de/scm/EIST16SC/EIST16SC-exercise.git)
- Base Build Plan ID: The identifier of the base build plan in the format
PROJECTKEY-PLANKEY
(e.g. EIST16SC-BASE) - Publish Build Plan URL: When set to true, students will see a link to their personalized build plan (e.g. for teaching release management)
- Release Date: When the exercise will be visible to students
- Due Date: The deadline until students have time to solve the exercise. Plase note: After this date, new results (i.e. a build with test cases after students have pushed their code) will be ignored by ArTEMiS
- Course: The course with which this exercise should be associated