Skip to content

fix(deploy): deploy test ECS by uploading images over SSH - #8

Merged
c1trua merged 11 commits into
developfrom
bugfix/deploy-test-upload-images
Apr 27, 2026
Merged

fix(deploy): deploy test ECS by uploading images over SSH#8
c1trua merged 11 commits into
developfrom
bugfix/deploy-test-upload-images

Conversation

@c1trua

@c1trua c1trua commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

Background

The previous test ECS deployment flow relied on pushing images to Docker Hub and pulling them from the server. That was unreliable in the current test environment and also made deployment results hard to verify.

Changes

  • switch the test deployment workflow from Docker Hub push/pull to build on the GitHub runner, upload images to ECS, and load them locally
  • upload docker-compose.yml, deploy.env, config.yaml, and image archives to /opt/cixing over SSH
  • pin dependency images used by the deployment workflow and compose file
  • add stricter API verification after deployment:
    • ensure the API container is created
    • ensure the container is running and healthy
    • verify /healthz inside the API container
    • recheck API stability after a short warmup period
  • improve workflow logs so deployment progress and final API status are visible
  • fix the migration step so it does not consume the remaining SSH heredoc input
  • clean stale compose state before deployment and remove uploaded image archives after a successful deployment

Impact

  • test ECS deployment no longer depends on Docker Hub access from the ECS server
  • deployment success now reflects actual API startup and health more accurately
  • no application business logic changes

Verification

  • docker compose --env-file <temp-env> -f deploy/compose/docker-compose.prod.yml config
  • make -f Makefile/makefile lint
  • make -f Makefile/makefile test
  • manual deploy-test workflow run succeeded
  • workflow logs confirmed:
    • migrations completed
    • API container started
    • API container reached running and healthy
    • /healthz returned 200
  • browser access to http://<test-server>:8080/healthz succeeded

@c1trua
c1trua merged commit 96f6faf into develop Apr 27, 2026
7 of 8 checks passed
@c1trua
c1trua deleted the bugfix/deploy-test-upload-images branch April 28, 2026 17:12
c1trua added a commit that referenced this pull request Jun 17, 2026
* docs(contributing): update CONTRIBUTING.md

* feat(cicd): add github actions workflow

* fix(workflow): update golanglint version

* fix(workflow): update golanglint version

* fix(lint): linter passed

* feat(oss): support cross-account assume role credentials

* ci(deploy): add manual test ECS deployment

* ci(deploy): add manual test ECS deployment (#4)

* fix(openapi): add rate_limited to error code enum (#7)

* fix(deploy): deploy test ECS by uploading images over SSH (#8)

* fix(deploy): upload images to ECS instead of pulling from Docker Hub

* fix(deploy): allow container to read test config

* fix(deploy): verify api health after test deployment

* fix(deploy): verify api stability after test deployment

* fix(deploy): clean stale compose state before test deployment

* fix(deploy): log api deployment status explicitly

* fix(deploy): prevent migrate step from consuming ssh input

* ci(deploy): auto deploy test ECS on develop push

* ci(ops): add test ECS ops workflow

* ci(ops): add test ops workflow and reduce healthcheck noise

* ci(ops): add OSS presign diagnostics

* feat(profile): add avatar upload flow (#9)

* feat: add avatar upload flow

* fix(profile): stabilize avatar upload integration tests

* feat: add https support

* fmt: reformat

* fix: autocert gateway permission error

* fix: autocert error

* fix: autocert error

* fix(gateway): fallback SNI for autocert

* Revert "Merge pull request #14 from Muxi-X/fix/gateway-sni-fallback"

This reverts commit 74bd0e0, reversing
changes made to 52e2f0d.

* Revert "Merge pull request #13 from Muxi-X/feat/https"

This reverts commit 52e2f0d, reversing
changes made to 0faebb0.

* Revert "Merge pull request #12 from Muxi-X/feat/https"

This reverts commit 0faebb0, reversing
changes made to ad6bc82.

* Revert "Merge pull request #11 from Muxi-X/feat/https"

This reverts commit ad6bc82, reversing
changes made to 7770d94.

* Revert "Merge pull request #10 from Muxi-X/feat/https"

This reverts commit 7770d94, reversing
changes made to 981c240.

* build(deploy): add nginx + certbot for https

Expose API via Nginx on 80/443 with automatic Let's Encrypt issuance/renewal while keeping a localhost debug port.

* chore: update test domain

* refactor: remove nginx config (#17)

* refactor: remove nginx config

* chore(ci): disable auto-deploy on push to develop during PR merge

* feat: add custom keyword upload endpoints (#18)

* feat(oss): migrate from Alibaba Cloud OSS to Qiniu Kodo (#19)

* feat(oss): migrate from Alibaba Cloud OSS to Qiniu Kodo

* perf(deploy): skip unchanged dependency images in test deploy

* ci(deploy-test): switch from SCP zip transfer to Alibaba Cloud ACR

- Push cixing-api image + 5 base images to ACR (Hangzhou registry)
- ECS pulls images from ACR via docker compose pull instead of gzip load
- Remove docker save/gzip/scp image transfer steps
- Remove /opt/cixing/images/ tarball cleanup
- Update docker-compose.prod.yml to reference ACR image paths
- Add ACR_USERNAME / ACR_PASSWORD to required secrets validation

* ci(deploy-test): fix docker login host error

* ci(deploy-test): push cixing-api image to Alibaba Cloud ACR

- Push image to registry.cn-hangzhou.aliyuncs.com/muxi/memento:<sha>
- Remove docker save/gzip/scp image transfer steps
- ECS pulls cixing-api from ACR, base images from Docker Hub
- Add ACR_USERNAME / ACR_PASSWORD to required secrets validation
- Note: CONFIG must also fix postgres DSN from 127.0.0.1 to postgres

* fix(deploy-test): pass ACR credentials via SSH environment

* ci(deploy-test): pull only cixing-api from ACR

* fix(oss): remove duplicate https:// prefix in qiniu upload host

* fix(oss): remove null

* fix(oss): use SrcUpHosts (upload domain) instead of GetIoHost (IO domain) for presign upload URL

* fix(oss): presign returns FormData token field instead of Authorization header for Qiniu Kodo

- storage.go: PresignPut uses FormFields { token: upToken } instead of Authorization header
- object_storage.go: PresignResult gains FormFields map
- OpenAPI spec: UploadPresignedTarget gains form_fields field, method enum adds POST
- Handlers: map FormFields through to API response
- Qiniu form upload requires multipart/form-data with token in the form body

* fix(ci): remove duplicate Configure SSH block and nginx references

* fix(oss): gofmt client.go struct field alignment

* chore(test): remove tests that reference removed OSS config fields

* fix(oss): remove unused functions and fix errcheck lint warning

* fix: remove unused functions, fix integration test for Qiniu URL style

* fix(ci): resolve lint errors and integration test failures after Qiniu migration

* fix(ci): remove dead Mirror step that references undefined ACR_REGISTRY (#20)

* ci(deploy): add prod deploy workflow, parameterize compose config (#21)

* docs: update README for v0.1.0 release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant