1. Assignment Submission - pnguye35/pal-tracker GitHub Wiki

Purpose You will use the Assignment Submission mechanism to keep us up-to-date with your lab project throughout the course. The mechanism is implemented as a gradle plugin. Many labs will require you to run a gradle task at the end to signify that you are done with the lab and ready to move on.

Make sure you have a recent version of gradle installed. If you need to install it, please follow the official instructions.

Setup We will do a bit of setup to make sure that you are ready to submit assignments.

Create an assignment-submission directory.

mkdir -p ~/workspace/assignment-submission Create a gradle wrapper in the assignment-submission directory.

cd ~/workspace/assignment-submission gradle wrapper Create a build.gradle file.

touch build.gradle Open the project in IntelliJ and add the following content to the build.gradle file:

buildscript { repositories { maven { url "http://platform-acceleration-lab-maven.s3.amazonaws.com" } jcenter() }

dependencies {
    classpath "io.pivotal.pal.assignments:assignments-plugin:4.7.3"
}

}

apply plugin: "io.pivotal.pal.assignments.plugin"

assignments { apiUrl = "https://assignments.education.pivotal.io/" emails = [ "[email protected]", "[email protected]", ] courseCode = "CND" }

defaultTasks "tasks" In the emails list, replace [email protected] and [email protected] with your email address and that of your partner (if you are pairing). Delete the second email address if you are working alone. Any email addresses must be the same as the ones used to register for this course.

You are encouraged to work with others on all assignments in this course. When you work with another student, submit the assignment for both of you by putting both emails in the emails list. If you change partners at any time, remember to update this list so that the you are still submitting on behalf of the right people.

Waveland If you are reading these instructions on a site where the URL contains the word waveland, set the apiUrl to the root URL (https://changeme-waveland.education.pivotal.io/, for example).

List assignments Each assignment has its own gradle task for submission. View a list of all assignments by running the following command.

./gradlew tasks Submit an assignment To ensure everything is working correctly we will submit a test assignment.

Give it a try by running:

./gradlew testAssignment You will see an error similar to the following:

:testAssignment FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':testAssignment'.

Need project property exampleUrl, use command line argument "-PexampleUrl=someValue"

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED We see this error because we are missing necessary lab configuration (an exampleUrl in this case) for this assignment.

Try again with the exampleUrl project property correctly set:

./gradlew testAssignment -PexampleUrl=http://www.example.com You will see the following output, which signifies a successfully submitted assignment.

:testAssignment

BUILD SUCCESSFUL Debugging Failures Many of the assignment tasks run a JUnit smoke test against your application on CF. If you get an error, the task will output a standard test assertion failure message. Use this message to fix the issue, then re-deploy your application and try again.

An assignment is only considered successful when the task outputs:

BUILD SUCCESSFUL