Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .github/classroom/autograding.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Initial step",
"setup": "",
"run": "mvn clean package",
"run": "mvn clean package -DskipTests=true",
"input": "",
"output": "",
"comparison": "included",
Expand All @@ -30,16 +30,6 @@
"timeout": 10,
"points": 10
},
{
"name": "Initial tests",
"setup": "",
"run": "mvn -q test",
"input": "",
"output": "",
"comparison": "included",
"timeout": 10,
"points": 10
},
{
"name": "Cucumber final tests",
"setup": "",
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/classroom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 16
uses: actions/setup-java@v2
with:
java-version: '16'
distribution: 'adopt'
- uses: education/autograding@v1
42 changes: 21 additions & 21 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,24 @@ jobs:
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/re21

deploy-app:
needs: publish-image
runs-on: ubuntu-latest
steps:
- name: Pull the released image
run: docker pull ${{ secrets.DOCKER_USERNAME }}/re21
- name: connect to the Heroku registry
run: |
docker login --username=_ \
--password=${{ secrets.HEROKU_API_KEY }} \
registry.heroku.com
- name: prepare the released image for deployment
run: |
docker tag ${{ secrets.DOCKER_USERNAME }}/re21 \
registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web
- name: push the image to heroku
run: docker push registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web
- name: release the image into a new container
run: heroku container:release web -a ${{ secrets.HEROKU_APP_NAME }}
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
# deploy-app:
# needs: publish-image
# runs-on: ubuntu-latest
# steps:
# - name: Pull the released image
# run: docker pull ${{ secrets.DOCKER_USERNAME }}/re21
# - name: connect to the Heroku registry
# run: |
# docker login --username=_ \
# --password=${{ secrets.HEROKU_API_KEY }} \
# registry.heroku.com
# - name: prepare the released image for deployment
# run: |
# docker tag ${{ secrets.DOCKER_USERNAME }}/re21 \
# registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web
# - name: push the image to heroku
# run: docker push registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web
# - name: release the image into a new container
# run: heroku container:release web -a ${{ secrets.HEROKU_APP_NAME }}
# env:
# HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ FROM openjdk:16-alpine
ENV PORT=8080
WORKDIR /app
COPY target/re-21-SHADED.jar .
CMD ["java", "-jar", "re-21-SHADED.jar"]
CMD ["java", "-jar", "re-21-SHADED.jar"]
1 change: 0 additions & 1 deletion src/main/java/Order.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public class Order {

private List<Drink> contents = new LinkedList<>();
private double taxes = 0.0;

private String owner;
public void setOwner(String who) { this.owner = who; }
private String recipient;
Expand Down
3 changes: 3 additions & 0 deletions src/test/java/OrderUnitTest.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import org.junit.Test;

import java.util.List;

import static org.junit.Assert.assertEquals;

public class OrderUnitTest {

@Test
public void empty_order_by_default() {
Order o = new Order();

o.setOwner("Romeo");
o.setRecipient("Juliet");
List<Order.Drink> drinks = o.getDrinks();
Expand Down