Closed dankore closed 3 years ago
You probably have a space somewhere in your vars. Double check: CAPROVER_URL , CAPROVER_PASSWORD , CAPROVER_APP
@githubsaturn, thank you.
I had CAPROVER_PASS instead of CAPROVER_PASSWORD.
Worked like a charm!
Now i'm having this error:
Error: (HTTP code 500) server error - Head https://registry.gitlab.com/v2/ds-templates/nextjs-mongodb/my-build-image/manifests/dfcde68d6519503c19793b9f102d9de8160c2aff: denied: access forbidden
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"repository","Class":"","Name":"ds-templates/nextjs-mongodb/my-build-image","Action":"pull"}]}]}
Any help would be greatly appreciated!
Make sure you follow steps 4 and 5 here: https://caprover.com/docs/ci-cd-integration.html#4--create-an-access-token-for-caprover
Make sure you follow steps 4 and 5 here: https://caprover.com/docs/ci-cd-integration.html#4--create-an-access-token-for-caprover
I did. In fact, I created another access token. The previous one was never used.
But also, the CI/CD won't run if I don't enable the shared runners or register mine. No mention of that in the tutorial link you shared. Maybe I missed something?
The tutorial is for an individual account. Shared runners are for orgs and group I imagine (?)
There is also another similar issue here: https://github.com/caprover/caprover-cli/issues/84 They ended up creating a new account and it worked... Now they are trying to find out what is the difference between the old and new account that caused the old account to break.
I confirmed your suspicion @githubsaturn, I was getting 500 HTTPS server error because the repo belonged in a group in Gitlab.
I created a new project (repo) that does not belong to a group and it worked!
Same solution for issue #84
If anyone has a solution for a grouped projects please post.
You can follow up with gilab folks on what the difference is between group and individual projects. But from CapRover side, there is no distinction as long as you define the image prefix and username correctly.
Just as an FYI in case someone ends up here via google:
I ran into this error on GitLab CI/CD due to the fact that Group variables are, by default, set to be only available in protected branches. "master" is protected by default, which is why every other branch will cause failed build since group env vars are empty. You can make group variables available in unprotected branches:
test is the name of my Caprover app
Dockerfile:
.gitlab-ci.yml