Repository navigation
ci: deploy with the javaBin platform pipeline - #6
Open
Alexanderamiri wants to merge 1 commit into
Open
Alexanderamiri wants to merge 1 commit into
Alexanderamiri wants to merge 1 commit into
Conversation
Alexanderamiri
added this pull request to stack #9
October 24, 2026 13:32
This was referenced Oct 24, 2026
Alexanderamiri
force-pushed
the
platform/3-ci
branch
from
October 24, 2026 13:36
1505b8b to
d1cd722
Compare
Alexanderamiri
force-pushed
the
platform/3-ci
branch
from
October 24, 2026 13:38
d1cd722 to
b0b1c4e
Compare
deploy.yml calls javaBin/platform's javabin.yml: mvn verify against a postgres:17 service (the same database setup as docker/postgres), then on master terraform apply, docker build and ECS rollout. The new Dockerfile builds the jar and runs it with plain java -jar: ECS injects configuration as env vars, so the image has no SOPS, no AWS CLI and no encrypted env file. The SOPS image moves to Dockerfile.cdk and the CDK stack points at it, so the old stack can still be redeployed until the cutover is done. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Alexanderamiri
force-pushed
the
platform/3-ci
branch
from
October 24, 2026 13:50
b0b1c4e to
2d81b8a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This replaces "run
cdk deployby hand" with the shared platform pipeline. It builds, tests, plans with a review and deploys on every merge tomaster, with no AWS secrets in the repo.What
.github/workflows/deploy.ymlcallsjavaBin/platform/.github/workflows/javabin.yml@mainwithjava_version: 21andtest_postgres_image: postgres:17, dbmoresleepunit, user and passwordlocaldevuser. That is the setupdocker/postgrescreates andBaseTestClassexpects.Dockerfile(platform image):eclipse-temurin:21-jre-jammyrunningjava -jar app.jaras uid 1000..enc.env. ECS injects the configuration as env vars.-XX:MaxRAMPercentage=75keeps the heap inside the 512 MB task.:edgeimage that submittheforce's compose file uses. Production values (SERVER_PORT=5000,DO_FLYWAY_MIGRATION=false, ...) come fromapp.yaml.Dockerfile.cdk.cdk/lib/moresleep-stack.tsandrun-local.shpoint at it, so the old stack can still be redeployed (cdk-deploy.yml) until the cutover is safely done.How the platform piece works
masterbuild-jvmmvn verifywith apostgres:17service container onlocalhost:5432expandterraform/fromapp.yaml; commits to the PR branch if it changedtf-planterraform planwith the team's role, then an AI risk review; both are posted as a PR commenttf-applydocker-buildDockerfile, pushessha-<commit>andlatestto ECRmoresleep-moresleepecs-deploymoresleepGitHub team and hands out short-lived credentials forjavabin-ci-team-moresleep. That role can only touch resources taggedteam=moresleep, or untagged ones likedbmoresleepbefore the import.master).What the first merge does: creates the ECR repo, target group, listener rule 120,
moresleep.javazone.no, five SSM secrets (allPLACEHOLDER), log group, IAM role, alarms, and the ECS service with 0 tasks. It importsdbmoresleep, addsteam=moresleepand the other tags, and turns on deletion protection. Production (sleepingpill.javazone.noon the old stack) is untouched.How verified
Buildworkflow on chore: make master match the deployed awsdocker line #4, the same database and user as thetest_postgres_*inputs). TheBuildworkflow also builds thisDockerfileon this PR.deploy.ymllints clean (actionlint) against feat(ci): deploy from the default branch and offer Postgres to JVM tests platform#154'sjavabin.yml. Against current platformmainit fails withinput "test_postgres_image" is not defined, which is why theDeploycheck shows a startup failure until #154 merges.--read-only --tmpfs /tmp --user 1000 --memory 512m, configured only through env vars, againstpostgres:17.GET /returns 200 and/public/allSessionsreturns 200.POST /data/conferencereturns 401; with the ALLACCESS user it returns 200.expandfails onadoptuntil feat(app-yaml): adopt an existing RDS instance and Route53 record platform#155 is merged, andtf-planfails until themoresleepteam exists (javaBin/registry#40) and the repo is in that GitHub team.Merge when
All of these are done:
gh api -X PUT orgs/javaBin/teams/moresleep/repos/javaBin/moresleep -f permission=push.dbmoresleepexists and isavailable(aws rds describe-db-snapshots --db-snapshot-identifier dbmoresleep-pre-platform-migration-<date>). The first apply imports the production instance and changes its tags and deletion protection; without this snapshot the only backups are the 7-day automated ones. A platform admin takes it; it has not been taken yet.1 to import, only tags,deletion_protectionand final-snapshot settings changing onmodule.rds_main.aws_db_instance.this, and 0 to destroy. Every Deploy run on this stack fails until #154, #155 and registry#40 are merged (startup_failure, then expand, then tf-plan), so that re-run is the first end-to-end proof.🤖 Generated with Claude Code