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
50 changes: 50 additions & 0 deletions .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI/CD Pull Request

on:
pull_request:
branches:
- main

jobs:
build_test_app:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v6

- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 21
cache: maven

- name: Build project
run: |
./mvnw clean package -DskipTests
working-directory: itj-shopping-cart

- name: Run tests
run: |
./mvnw test
working-directory: itj-shopping-cart

deploy_java_app:
runs-on: ubuntu-latest
needs: build_test_app

steps:
- name: Checkout Code
uses: actions/checkout@v6

- name: Install Heroku CLI
run: curl https://cli-assets.heroku.com/install.sh | sh
shell: bash

- uses: akhileshns/heroku-deploy@v3.14.15
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY_SWEBP }}
heroku_app_name: "itj-shopping-cart"
heroku_email: ${{ vars.HEROKU_USERNAME_SWEBP }}
appdir: "itj-shopping-cart"
usedocker: true
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HELP.md
target/
.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
Binary file added itj-shopping-cart/.DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions itj-shopping-cart/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions itj-shopping-cart/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions itj-shopping-cart/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions itj-shopping-cart/.idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions itj-shopping-cart/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions itj-shopping-cart/.idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions itj-shopping-cart/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions itj-shopping-cart/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
13 changes: 13 additions & 0 deletions itj-shopping-cart/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Build Stage
FROM maven:3.9-eclipse-temurin-21 AS build
WORKDIR /app
COPY pom.xml .
COPY src ./src
RUN mvn clean package -DskipTests

# Run Stage
FROM eclipse-temurin:21-jre-alpine
WORKDIR /app
COPY --from=build /app/target/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.jar"]
21 changes: 21 additions & 0 deletions itj-shopping-cart/HELP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Read Me First
The following was discovered as part of building this project:

* The original package name 'com.example.itj-shopping-cart' is invalid and this project uses 'com.example.itj_shopping_cart' instead.

# Getting Started

### Reference Documentation
For further reference, please consider the following sections:

* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.5.5/maven-plugin)
* [Create an OCI image](https://docs.spring.io/spring-boot/3.5.5/maven-plugin/build-image.html)

### Maven Parent overrides

Due to Maven's design, elements are inherited from the parent POM to the project POM.
While most of the inheritance is fine, it also inherits unwanted elements like `<license>` and `<developers>` from the parent.
To prevent this, the project POM contains empty overrides for these elements.
If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides.

Loading
Loading