Thank you @FlorianSuchan . Here are a few optimizations you can do in your script.
Small workflow optimization
Instead of deploying each service independently, you can deploy the environment and then deploy the app version you expect (I still think we need to improve this).
So instead of this:
- name: Deploy Environment
env:
QOVERY_CLI_ACCESS_TOKEN: ${{ secrets.api-token }}
shell: bash
run: |
curl -s https://get.qovery.com | bash
qovery database deploy \
--organization
--project
--environment ${{ inputs.new-environment-name }} \
--database pg-1 \
--watch
qovery database deploy \
--organization
--project
--environment ${{ inputs.new-environment-name }} \
--database pg-2 \
--watch
qovery database deploy \
--organization
--project
--environment ${{ inputs.new-environment-name }} \
--database redis \
--watch
qovery application deploy \
--organization
--project
--environment ${{ inputs.new-environment-name }} \
--applications application-1,application-2,application-3 \
--commit-id ${{ inputs.commit-id }} \
--watch
You can do this:
- name: Deploy Environment
env:
QOVERY_CLI_ACCESS_TOKEN: ${{ secrets.api-token }}
shell: bash
run: |
curl -s https://get.qovery.com | bash
qovery environment deploy \
--organization
--project
--environment ${{ inputs.new-environment-name }} \
--watch
qovery application deploy \
--organization
--project
--environment ${{ inputs.new-environment-name }} \
--applications application-1,application-2,application-3 \
--commit-id ${{ inputs.commit-id }} \
--watch
Note: It’s a small optimization, but it will save you seconds to minutes of deployment.
Ensure you have correctly configured your deployment order.
Predictable URL / Domain
Good news is that you can get predictable URLs with the Qovery CLI. So inside your pipeline, you could add a step to change the URLs of your applications.
Let’s say Qovery provides to your app the following URL https://p8080-zaa190093-ze2b27453-gtw.z809f9644.rustrocks.cloud
. With the CLI you can create a custom domain that will be anything before .z809f9644.rustrocks.cloud
. For instance, if I want to create a domain app-1-e2e-123.z809f9644.rustrocks.cloud
I just need to execute the following commands from the Qovery CLI:
qovery application domain create -n "app name" --organization "your org" --environment "your env" --domain app-1-e2e-123.z809f9644.rustrocks.cloud
To make sure it works all the time, you can use the following:
# This will return "z809f9644.rustrocks.cloud"
root_domain=`qovery application domain list -n "app name" --organization "your org" --environment "your env" | grep "BUILT_IN_DOMAIN" | head -1 | awk '{print $5}' | cut -d . -f 2-`
qovery application domain create -n "app name" --organization "your org" --environment "your env" --domain app-1-e2e-123.$root_domain
Then you must redeploy your app(s) where you added the predictable domain. You’ll be able to get access to your app via the domain you defined.
If you want to use a predictable domain with your domain, check out this guide.
–
Let me know if it helps.