Skip to content

Conversation

@pjcdawkins
Copy link
Contributor

Summary

Updates the GitLab CI push solution example to use the Upsun CLI instead of manual SSH key management and raw API calls.

Changes

  • New .upsun-cli template: Uses pjcdawkins/platformsh-cli image with Upsun config overlay
  • Modern GitLab CI syntax: Uses rules: instead of deprecated only:/except:
  • GitLab environments integration: Added environment: blocks with dotenv artifacts
  • Helper scripts: Added scripts/push.sh, scripts/cleanup.sh, scripts/delete.sh
  • Variable naming: Uses UPSUN_ prefix consistently (UPSUN_CLI_TOKEN, UPSUN_PROJECT_ID, etc.)

New files

  • examples/gitlab-ci/scripts/push.sh - Handles pushing and environment activation
  • examples/gitlab-ci/scripts/cleanup.sh - Cleans up merged environments
  • examples/gitlab-ci/scripts/delete.sh - Deletes a specific environment

Related

🤖 Generated with Claude Code

Modernize the GitLab CI push solution example to use the Upsun CLI instead of manual SSH key management and raw API calls.

Changes:
- Add .upsun-cli template using pjcdawkins/platformsh-cli image with Upsun config overlay
- Replace deprecated only:/except: with modern rules: syntax
- Use CI_DEFAULT_BRANCH instead of hardcoded 'main'
- Add GitLab environment: integration with url, auto_stop_in, and on_stop
- Use dotenv artifacts to expose PRIMARY_URL
- Separate jobs for push-production, push-review-env, cleanup-review-envs, and delete-review-env
- Use UPSUN_ prefixed variables (UPSUN_PROJECT_ID, UPSUN_PARENT_ENV, UPSUN_TARGET_BRANCH, UPSUN_CLI_COMMAND, UPSUN_CLI_TOKEN)
- Add helper scripts (push.sh, cleanup.sh, delete.sh) based on ai-api reference implementation
- Use upsun push --activate --force instead of manual git push + API calls
- Use upsun url --primary --pipe to get environment URL
- Add UPSUN_NO_CLONE_PARENT option for review environments

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

2 participants