Skip to content
Merged
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
21 changes: 17 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,35 @@ permissions:
contents: read

jobs:
shellcheck:
name: "ShellCheck"
runs-on: ubuntu-24.04
steps:
- uses: Scalingo/actions/shellcheck@8c4d8c7b3d03b58f44873ba2e281f1c2de2a3381

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we tend to prefer sticking to main for actions repository so that we benefit from new versions instantly

Suggested change
- uses: Scalingo/actions/shellcheck@8c4d8c7b3d03b58f44873ba2e281f1c2de2a3381
- uses: Scalingo/actions/shellcheck@main

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I agree with you, I have the displeasure to let you know that merging is blocked by Semgrep if I don't put a precise SHA checksum here -_-

with:
severity: style
files: |
vendor/cmnlib.sh
bin/*

unit-tests:
name: "Unit Tests (${{ matrix.stack }})"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
stack:
- scalingo-22
- scalingo-24
- scalingo-26
container:
image: "scalingo/${{ matrix.stack }}:latest"
env:
STACK: "${{ matrix.stack }}"
steps:
- name: 🛎 Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: 🔎 Run tests
- name: Run tests
run: |
test/run
...
Empty file removed .gitmodules
Empty file.
13 changes: 13 additions & 0 deletions INVENTORY-default.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This is a tab-separated file.
# Each row has its own line and must have 3 columns (fields) separated by a tab character: version, URL and checksum.
# The default value (the one used as default by the buildpack) must have a fourth column, whose value MUST be "default".
# Only one row can have the "default" column.
# Lines starting with a # are treated as comments. Empty lines are ignored.

10.1.59.0 https://buildpacks-repository.s3.eu-central-1.amazonaws.com/webapp-runner-10.1.59.0.jar sha256:4039bb1d41680a5c2aac4bca4ae93e58f8a764def81f434923563401610739da
10.1.57.0 https://buildpacks-repository.s3.eu-central-1.amazonaws.com/webapp-runner-10.1.57.0.jar sha256:ac1013f20aca7489dba9f690b6a3d5db8e123821e9f26041714719d41ec0509d
10.1.56.0 https://buildpacks-repository.s3.eu-central-1.amazonaws.com/webapp-runner-10.1.56.0.jar sha256:482dc7c585058b0066dc6a435400467aa8f634a7beaac807d8743fc946ab088b

9.0.121.0 https://buildpacks-repository.s3.eu-central-1.amazonaws.com/webapp-runner-9.0.121.0.jar sha256:a8d6f2dc2bcfa9467d6f8509fc89e7d63b443c0774f139258b1897dcd114d814 default
9.0.120.0 https://buildpacks-repository.s3.eu-central-1.amazonaws.com/webapp-runner-9.0.120.0.jar sha256:9d4830d1d2a5a60a509d7e7486541e7211b051df8f03a2bb0ef995f9f0acff80
9.0.119.0 https://buildpacks-repository.s3.eu-central-1.amazonaws.com/webapp-runner-9.0.119.0.jar sha256:cbe86423a51bcee590bfc176c6f693f403c747ad464577d928b8ff338b9c088d
13 changes: 13 additions & 0 deletions INVENTORY-main.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This is a tab-separated file.
# Each row has its own line and must have 3 columns (fields) separated by a tab character: version, URL and checksum.
# The default value (the one used as default by the buildpack) must have a fourth column, whose value MUST be "default".
# Only one row can have the "default" column.
# Lines starting with a # are treated as comments. Empty lines are ignored.

10.1.59.0 https://buildpacks-repository.s3.eu-central-1.amazonaws.com/webapp-runner-main-10.1.59.0.jar sha256:e4c5a43a4032f3bf4ce78e4f00d5bcb5f382d033538405003350d5d8cc9bea58
10.1.57.0 https://buildpacks-repository.s3.eu-central-1.amazonaws.com/webapp-runner-main-10.1.57.0.jar sha256:e110531d879a03c4cd2335442e9700e59900631a11079c6d12329413e9d20ed5
10.1.56.0 https://buildpacks-repository.s3.eu-central-1.amazonaws.com/webapp-runner-main-10.1.56.0.jar sha256:4a20bc4c7131aff0beae8c34b0765dd07cc7f399e13a1f986e5b678dc8c3ca0c

9.0.121.0 https://buildpacks-repository.s3.eu-central-1.amazonaws.com/webapp-runner-main-9.0.121.0.jar sha256:e215d430ed800e9675cf70c7ce61c8e307b8ff611d66ef44199658643f1ea38b default
9.0.120.0 https://buildpacks-repository.s3.eu-central-1.amazonaws.com/webapp-runner-main-9.0.120.0.jar sha256:5829b7c99a2094247dcb63d5972f8246e8a6ef80afff294320a9ebd951ae724a
9.0.119.0 https://buildpacks-repository.s3.eu-central-1.amazonaws.com/webapp-runner-main-9.0.119.0.jar sha256:ec6e64b0ab590711e1e0861360e789b15a64a5c457c6491eabf0dad0b6a9d41a
12 changes: 7 additions & 5 deletions Makefile

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: I hate Makefile. Do we want to keep using one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I have the same feeling towards Makefiles.
But it's been asked by @leo-scalingo.
I personnaly don't see any blocker to remove it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the teasks in the makefile are still working I would keep it since it's really simple, otherwise remove it. I don't remember asking haha

Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ BASH_COMMAND := /bin/bash
.DEFAULT := all

all: test
test: test22
test: test22 test24 test26

test26: STACK := "scalingo-26"
test24: STACK := "scalingo-24"
test22: STACK := "scalingo-22"

test22: BASH_COMMAND := test/run
test22: IMAGE := "scalingo/$(STACK):latest"
test22:
test22 test24 test26: BASH_COMMAND := test/run
test22 test24 test26: IMAGE := "scalingo/$(STACK):latest"
test22 test24 test26:
@echo "Running tests in Docker using $(IMAGE)"
@docker run --pull always --mount type=bind,src=$(PWD),dst=/buildpack --workdir /buildpack --rm --interactive --tty --env "GITLAB_TOKEN=$(GITLAB_TOKEN)" --env "GITHUB_TOKEN=$(GITHUB_TOKEN)" --env "STACK=$(STACK)" $(IMAGE) bash -c "$(BASH_COMMAND)"
@docker run --pull always --mount type=bind,src=$(PWD),dst=/buildpack,readonly --workdir /buildpack --rm --interactive --tty --env "GITLAB_TOKEN=$(GITLAB_TOKEN)" --env "GITHUB_TOKEN=$(GITHUB_TOKEN)" --env "STACK=$(STACK)" $(IMAGE) bash -c "$(BASH_COMMAND)"
65 changes: 30 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,50 @@
# buildpack: Java WAR
# Java WAR Buildpack

This is a [buildpack](http://doc.scalingo.com/buildpacks) for WAR file.
Run a Java Web Application Archive (`.war` file) on Scalingo using this
buildpack.

## Usage

### Detection
## Documentation

If the `WAR_PATH` environment variable is set, this buildpack checks if a .war
file exists where `WAR_PATH` points. If the file does actually exist, it is
used and served as the application. Otherwise, the buildpack fails.
See our official documentation:
👉 https://doc.scalingo.com/platform/deployment/deploy-java-jar-war

If `WAR_PATH` is not set, the buildpack falls back to checking if a .war file
exists at the root of the project and uses it if it does exist.
This buildpack first deploys a Java Development Kit (JDK) into your container.

If you want to use a .war file stored at the root of your application, we
advise to unset the `WAR_PATH` environment variable and let the platform do its
magic.
It then deploys a standalone CLI tool named **Webapp Runner**. Webapp
Runner is based on the Apache Tomcat HTTP web server. It allows to run a WAR
application on Scalingo.

### Deployment Workflow

During the *`BUILD`* phase, this buildpack:
## Default Supported Version

1. Downloads and installs the Java Runtime Environment.
2. Downloads and installs a [webapp-runner](https://github.com/heroku/webapp-runner).
3. Validates the build.
The default Java JDK deployed by this buildpack depends on your [stack]:

:tada: This process results into a scalable image, ready to be packaged into a
container.
- For `scalingo-22`: OpenJDK 1.8
- For `scalingo-24`: OpenJDK 25
- For `scalingo-26`: OpenJDK 25

### Environment
The default Webapp Runner deployed by this buildpack is defined in one of the
[inventory] files of the buildpack.

The following environment variables are available for you to tweak your
deployment:

#### `JAVA_VERSION`
## Maintenance Status

Version of the Java Runtime Environment to deploy.\
Defaults to `1.8`
This buildpack is maintained by Scalingo solely for the deployment assets and
integration guidance provided in this repository and its associated
documentation.

#### `JAVA_WEBAPP_RUNNER_VERSION`
Applying Java and Webapp Runner upgrades, as well as security patches remains
the responsibility of the customer by updating the corresponding environment
variables and redeploying the application.

Version of the webapp-runner (Tomcat) to install and use.\
Defaults to `9.0.120.0`

#### `WEBAPP_RUNNER_VERSION`
Should Scalingo discontinue maintenance of this buildpack or no longer
recommend its use, a notice period of at least six months will be provided
whenever feasible, except where immediate action is required due to security
concerns or external constraints.

**Deprecated**, please use [`JAVA_WEBAPP_RUNNER_VERSION`](#java_webapp_runner_version).

#### `WAR_PATH`
[inventory]: INVENTORY-default.tsv?plain=1

Path to the .war file you want to run.\
When unset, the platform tries to run a .war file at the root of the
application.\
Defaults to being unset
[stack]: https://doc.scalingo.com/platform/internals/stacks/overview
Loading