Skip to content

fix: simplify Forge AWS deploy to branch and slot - #16249

Merged
jamesfredley merged 1 commit into
7.0.xfrom
fix/forge-aws-workflow-simple-7.0
Aug 28, 2026
Merged

jamesfredley merged 1 commit into
7.0.xfrom
fix/forge-aws-workflow-simple-7.0

Conversation

@jamesfredley

Copy link
Copy Markdown
Contributor

Description

Simplify Forge AWS deploy to branch + slot.

  • Remove source_ref, release, stack, and region inputs. Use the branch from Use workflow from.
  • Hard-code us-east-1 and grails-forge-shared.
  • Package only (awsElasticBeanstalk); do not run Forge tests on deploy.
  • Grant cloudformation:GetTemplate so Elastic Beanstalk UpdateEnvironment works.
  • Stop re-declaring com.gradleup.shadow (it is already on the Micronaut classpath).

Keep only the slot input. Build the branch selected in Use workflow from.
Hard-code region and stack name. Package without running Forge tests.
Give the deploy role cloudformation:GetTemplate so UpdateEnvironment works.
Stop re-declaring the Shadow plugin; configure shadowJar when Micronaut applies it.
Copilot AI lite review requested due to automatic review settings August 28, 2026 17:17
@jamesfredley
jamesfredley merged commit 9ba323f into 7.0.x Aug 28, 2026
45 of 46 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Simplifies the Forge AWS Elastic Beanstalk deployment workflow to deploy by branch + slot, with fewer dispatch inputs and a streamlined packaging/deploy sequence.

Changes:

  • Removes workflow_dispatch inputs for release/stack/region and hard-codes shared stack + region.
  • Reads Java version from gradle.properties, packages only the EB artifact, and shortens job timeout.
  • Expands CloudFormation permissions needed for Elastic Beanstalk environment updates.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
grails-forge/infrastructure/shared.yaml Adds CloudFormation permissions (DescribeStackResources, GetTemplate) for EB updates.
grails-forge/grails-forge-web-netty/build.gradle Makes ShadowJar configuration resilient to different shadow plugin IDs and adjusts EB zip task wiring.
grails-forge/docs/aws-elastic-beanstalk.md Updates deployment documentation to match the new “Use workflow from” + slot model.
.github/workflows/forge-deploy-aws.yml Simplifies deploy inputs, reads JDK version from properties, packages only, and combines upload+deploy logic.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

# first deployment, add this workflow at the same path on the default branch,
# then dispatch it with 7.0.x selected as the run ref.
# Dispatch from the maintenance branch that should be built (Use workflow from).
# Choose the slot. Region, stack name, and JDK come from that branch.
Comment on lines +60 to +70
- name: "Read Java version"
id: jdk
shell: bash
run: |
set -euo pipefail
java_version="$(sed -n 's/^javaVersion=//p' gradle.properties | tr -d '\r' | awk 'NR==1')"
if [[ -z "${java_version}" ]]; then
echo "gradle.properties must define javaVersion." >&2
exit 1
fi
printf 'version=%s\n' "${java_version}" >> "${GITHUB_OUTPUT}"
Comment on lines 85 to +86
TaskProvider<Zip> awsElasticBeanstalk = tasks.register('awsElasticBeanstalk', Zip) {
dependsOn(shadowJarTask)
dependsOn('shadowJar')
Comment on lines +92 to 94
from({ tasks.named('shadowJar').get().archiveFile.get() }) {
rename { 'app.jar' }
}
Comment on lines +76 to +80
['com.gradleup.shadow', 'com.github.johnrengelman.shadow'].each { pluginId ->
pluginManager.withPlugin(pluginId) {
tasks.named('shadowJar', ShadowJar).configure {
reproducibleFileOrder = true
preserveFileTimestamps = false
Comment on lines +186 to +187
echo "Deployment failed. Rolling back ${ENVIRONMENT_NAME}."
aws elasticbeanstalk update-environment --environment-name "${ENVIRONMENT_NAME}" --version-label "${previous_version}" >/dev/null || true
@jamesfredley
jamesfredley deleted the fix/forge-aws-workflow-simple-7.0 branch August 28, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants