livecycle / preevy

Quickly deploy preview environments to the cloud!
https://preevy.dev
Apache License 2.0
2.06k stars 78 forks source link

Preevy deployment with Google cloud #153

Closed eliyabar closed 1 year ago

eliyabar commented 1 year ago

Currently, if you'll try to deploy with the GCP driver while your branch name contains Uppercase characters, you'll get the following error

Run echo "/home/runner/work/_actions/livecycle/preevy-up-action/v1.2.0" >> $GITHUB_PATH
Run # Convert the docker-compose-yaml-paths input to an env var
Docker file paths docker-compose.yml
Running Preevy with files: -f docker-compose.yml -f docker-compose.dev.yml 
Using environment ID: preevy-saas-eliyaenvironmentsUI
- Creating Google Cloud machine
✖ Creating Google Cloud machine: Creating from existing snapshot
    Error: Invalid value for field 'resource.labels': ''. Label value 
    'preevy-saas-eliyaenvironmentsUI' violates format constraints. The value 
    can only contain lowercase letters, numeric characters, underscores and 
    dashes. The value can be at most 63 characters long. International 
    characters are allowed.
    Code: 3

Possible solution: lowercase the resource label value.

Yshayy commented 1 year ago

A good solution might be to set the cloud-machine label to: substr(lower(envID), 0, 56)+substr(md5(envID), 0, 7) This would create a label that is both predictable, readable and unique