Question

App connected to GitLab doesn't pull latest commit on deployment

Posted February 15, 2021 504 views
DigitalOcean App PlatformNext.js

I have a DO App that is deploying a static site connected to GitLab. If I manually trigger a deployment it doesn’t pull the latest commit. It appears to be pulling the commit that was used for the initial deployment when I created the App. Is there anyway to clear the build cache and force it to pull the latest commit?

2 comments
  • To clarify I have “Autodeploy code changes” turned off. I am going to use doctl apps create-deployment to deploy changes from a GitLab CI job so that I can run other jobs (lint, test, etc) before deploying. But when I run doctl apps create-deployment DO App Platform doesn’t use the latest commit. Same thing happens if I click the “Deploy” button in the UI.

  • To clarify further (I couldn’t edit my comment) the command I am using is doctl apps create-deployment <app_id> --force-rebuild -t <access_token>

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
4 answers

Hello, this should be resolved now.

Hello, thanks for bringing this to attention. We have investigated this and confirmed there is an issue in certain scenarios when using GitLab and create-deployment CLI option and combination of these settings. We should have a fix shortly. You should not have to update doctl to resolve this once we have it fixed. Unfortunately in the mean time I think the only workaround is to enable automatic deployment on code changes. This can be manage in a stricter sense if needed, if you use a branch that you control merges to and set that as the source.
We will update this community question when we confirm the fix is rolled out.

@bojand great thanks so much for the quick fix! I just tested and can confirm this is now working for me!

Same thing happened to me with github instead of gitlab.
automatic deployment did not fix issue.
Had to completely destroy app and create again with Automatic deployment enabled