老师好
$ if [ $(docker ps -aq --filter name=web)] then docker rm -f web;fi
bash: eval: line 70: syntax error near unexpected token `fi’
ERROR: Job failed: exit status 2
我的代码如下
stages:
docker-deploy:
stage: deploy
script:
- docker build -t flask-demo .
- if [ $(docker ps -aq --filter name=web)] then docker rm -f web;fi
- docker run -d -p 5000:5000 --name web flask-demo
tags:
- test