A
A
Andy Oker2021-01-14 11:53:22
git
Andy Oker, 2021-01-14 11:53:22

CI/CD error in gitlab. How to fix?

For the last 3 pushes to gitLab, I have an error in the CI / CD tab (failed status) and, accordingly, changes on the server are not applied.
6000055ac3417411061163.png

He writes about the error like this:
600005f36d3a0653647013.png

Then I noticed:
error: Your local changes to the following files would be overwritten by merge:
package-lock.json
Please commit your changes or stash them before you merge.

But I don't quite understand. Why and where does he ask me to commit or hide in a stash if I have already made a commit and transfer it to gitlab?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
smilingcheater, 2021-01-14
@Ashlis

I will supplement the answer above, where the changes came from. The screenshot shows that a separate script is launched for deployment, which executes
cd ... folder ... && git pull && npm install && ...
i.e. go to some folder on the server, pull changes from git, start installing npm packages and build something. So, executing the npm install command can overwrite the package-lock.json file (which is marked as changed on your screenshot). For NPM to set everything clearly according to the lock file, you need to use the npm ci command, https://docs.npmjs.com/cli/v6/commands/npm-ci If there is no access to the server, then you can ask the one who has it .
Further, to fix the current situation, I see the simplest option: 1. go to the server with your hands and roll back the changes in this file. 2. change command in .gitlab-ci.yml
If this is a problem, you can modify the deploy command by adding a reset of the repository state to it, for example, via git reset --hard (be careful with this command!) Before executing git pull.

G
GavriKos, 2021-01-14
@GavriKos

Well, apparently, where the application is trying to deploy, the delivery is also made through the git and THERE there are untracked changes. Where they came from is another question, either in the process of work something is created and not deleted, or something went wrong during some kind of deployment

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question