在Git lab Runner中解决远程原点已存在的错误

问题描述 投票:0回答:1

我在Git lab runner终端的错误

fatal: remote origin already exists.
warning: failed to remove code/ecom_front_proj/dist/sections: Permission denied
ERROR: Job failed: exit status 1

我正试图通过git runner使用CI CD将我的项目部署到AWS服务器。第一次代码成功部署。如果我第二次提交它会显示上述错误。

如果我删除我的跑步者并创建新的跑步者,它就会成功部署。我不知道如何删除已存在的远程源文件。

我的Git.yml

image: docker
> 
> services:
>   - docker:dind
> 
> stages:
>   - test
>   - deploy
> 
> test:   stage: test   only:
>     - master
>       script:
>     - echo run tests in this section
> 
> step-deploy-prod:   stage: deploy   only:
>     - master   script:
>    
>     - sudo docker system prune -f
>     - sudo docker volume prune -f
>     - sudo docker image prune -f
>     - sudo docker-compose build --no-cache
>     - sudo docker-compose up -d   environment: development

我的Docker文件

FROM node:6 LABEL Aathi <[email protected]>
> 
> RUN apk update && apk add git RUN apk add nodejs  RUN apk add nginx
> RUN set -x ; \   addgroup -g 82 -S www-data ; \   adduser -u 82 -D -S
> -G www-data www-data && exit 0 ; exit 1
> 
> COPY ./nginx.conf     /etc/nginx/nginx.conf
> #COPY ./localhost.crt /etc/nginx/localhost.crt
> #COPY ./localhost.key /etc/nginx/localhost.key COPY ./code/ecom_front_proj /sections WORKDIR sections RUN npm install RUN
> npm install -g @angular/cli RUN ng build --prod

我的码头撰写文件

version: '2'
> 
> services:   web:
>     container_name: nginx
>     build: .
>     ports:
>       - "4200:4200"
>     command: nginx -g "daemon off";
>     volumes:
>       - ./code/ecom_front_proj/dist/sections:/www:ro

我的nginx文件

user www-data; worker_processes 1; pid /run/nginx.pid;
> 
> events {  worker_connections 768;     # multi_accept on; }
> 
> http {    sendfile off;   tcp_nopush on;  tcp_nodelay on;
>   keepalive_timeout 65;   types_hash_max_size 2048;
> 
>   include /etc/nginx/mime.types;  default_type
> application/octet-stream;
> 
>   #access_log /var/log/nginx/access.log;  #error_log
> /var/log/nginx/error.log;
> 
>   gzip on;    gzip_disable "msie6";
> 
>       server {        #listen 8443 ssl;       listen 4200;        #server_name 
> localhost;
> 
>       #ssl_certificate      localhost.crt;        #ssl_certificate_key 
> localhost.key;
> 
>       location / {
>             root  /sections/dist/sections;
>             index index.html;
>          }
>       
>       } }
continuous-integration gitlab devops gitlab-ci-runner cd
1个回答
0
投票

看起来你运行gitlab-runner版本11.9.0,它有一个bug

或者,您的gitlab-runner安装时具有不允许其更改上述路径中的文件结构的权限,请考虑使用reinstalling或添加这些权限。

© www.soinside.com 2019 - 2024. All rights reserved.