Compare commits
3 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
aa41b9c2de | |
|
|
00b913c0c0 | |
|
|
5d67cd42ed |
|
|
@ -0,0 +1,57 @@
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: test
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: gong921123/debian-nginx-php114-74:latest
|
||||||
|
pull: if-not-exists
|
||||||
|
commands:
|
||||||
|
- composer -v
|
||||||
|
- ls -a
|
||||||
|
- composer install -v
|
||||||
|
|
||||||
|
- name: deploy-push-images
|
||||||
|
depends_on:
|
||||||
|
- build
|
||||||
|
image: plugins/docker
|
||||||
|
pull: if-not-exists
|
||||||
|
settings:
|
||||||
|
repo: registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74-pro # 和dockerfile 分开
|
||||||
|
registry: registry.cn-shanghai.aliyuncs.com
|
||||||
|
insecure: true
|
||||||
|
username:
|
||||||
|
from_secret: aliyun_acr_username
|
||||||
|
password:
|
||||||
|
from_secret: aliyun_acr_password
|
||||||
|
dockerfile: docker/Dockerfile
|
||||||
|
tags: ${DRONE_TAG}
|
||||||
|
|
||||||
|
- name: deploy-pull-project
|
||||||
|
depends_on:
|
||||||
|
- deploy-push-images
|
||||||
|
image: appleboy/drone-ssh
|
||||||
|
pull: if-not-exists
|
||||||
|
settings:
|
||||||
|
host: 106.15.233.223
|
||||||
|
user:
|
||||||
|
from_secret: ssh_username
|
||||||
|
password:
|
||||||
|
from_secret: ssh_password
|
||||||
|
command_timeout: 5m
|
||||||
|
port: 22
|
||||||
|
script:
|
||||||
|
- echo ====开始部署=======
|
||||||
|
- docker stop $(docker ps | grep hyperf | awk '{print $1}')
|
||||||
|
- docker rm $(docker ps -a | grep hyperf | awk '{print $1}')
|
||||||
|
- docker rmi $(docker images | grep gong92-socl/debian-nginx-php114-74-pro | awk '{print $3}')
|
||||||
|
- docker pull registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74-pro:${DRONE_TAG}
|
||||||
|
- docker run -itd --name hyperf -p 8001:8001 -v /var/projects:/var/www -v /usr/local/docker/vloumn_nginx:/etc/nginx/conf.d -v /etc/hosts:/etc/hosts --privileged=true registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74-pro:${DRONE_TAG}
|
||||||
|
- echo ====部署成功=======
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
# branch:
|
||||||
|
# - develop
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
# - push
|
||||||
|
|
@ -17,7 +17,7 @@ steps:
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
pull: if-not-exists
|
pull: if-not-exists
|
||||||
settings:
|
settings:
|
||||||
repo: registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74
|
repo: registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74-pro
|
||||||
registry: registry.cn-shanghai.aliyuncs.com
|
registry: registry.cn-shanghai.aliyuncs.com
|
||||||
insecure: true
|
insecure: true
|
||||||
username:
|
username:
|
||||||
|
|
@ -44,9 +44,9 @@ steps:
|
||||||
- echo ====开始部署=======
|
- echo ====开始部署=======
|
||||||
- docker stop $(docker ps | grep hyperf | awk '{print $1}')
|
- docker stop $(docker ps | grep hyperf | awk '{print $1}')
|
||||||
- docker rm $(docker ps -a | grep hyperf | awk '{print $1}')
|
- docker rm $(docker ps -a | grep hyperf | awk '{print $1}')
|
||||||
- docker rmi $(docker images | grep gong92-socl/debian-nginx-php114-74 | awk '{print $3}')
|
- docker rmi $(docker images | grep gong92-socl/debian-nginx-php114-74-pro | awk '{print $3}')
|
||||||
- docker pull registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74:${DRONE_TAG}
|
- docker pull registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74-pro:${DRONE_TAG}
|
||||||
- docker run -itd --name hyperf -p 8001:8001 -v /var/projects:/var/www -v /usr/local/docker/vloumn_nginx:/etc/nginx/conf.d -v /etc/hosts:/etc/hosts --privileged=true registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74:${DRONE_TAG}
|
- docker run -itd --name hyperf -p 8001:8001 -v /var/projects:/var/www -v /usr/local/docker/vloumn_nginx:/etc/nginx/conf.d -v /etc/hosts:/etc/hosts --privileged=true registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74-pro:${DRONE_TAG}
|
||||||
- echo ====部署成功=======
|
- echo ====部署成功=======
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74:latest
|
FROM registry.cn-shanghai.aliyuncs.com/gong92-socl/hyperf3-php81-alpine-sw:v1
|
||||||
#FROM gong921123/debian-nginx-php114-74:latest
|
#FROM gong921123/debian-nginx-php114-74:latest
|
||||||
# 复制当前目录的所有 到上面容器的 var/www中去,变成一个新的镜像
|
# 复制当前目录的所有 到上面容器的 var/www中去,变成一个新的镜像
|
||||||
# 要想复制其他文件 就必须把dockerfile和其他文件放一起
|
# 要想复制其他文件 就必须把dockerfile和其他文件放一起
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue