feat:
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
mol
2023-11-06 16:37:49 +08:00
parent 35b7bf6aa4
commit 8ca3c29867
3 changed files with 75 additions and 1 deletions

64
.drone.yml Normal file
View File

@ -0,0 +1,64 @@
kind: pipeline # 定义一个管道
type: docker # 当前管道的类型
name: build # 当前管道的名称
steps: # 定义管道的执行步骤
# - name: build-project # 步骤名称
# image: node:18-bullseye # 当前步骤使用的镜像
# volumes:
# - name: node_modules
# path: /drone/src/node_modules
# commands: # 当前步骤执行的命令
# - pwd
# - npm config set registry https://registry.npm.taobao.org
# - npm i
- name: build-image
image: plugins/docker
depends_on: [clone]
settings:
username:
from_secret: docker_username
password:
from_secret: docker_passwd
dockerfile: Dockerfile
mirror: https://fpswa5tm.mirror.aliyuncs.com
registry: https://git.liliyamol.cn:8081
repo: git.liliyamol.cn:8081/mol/searxng
# auto_tag: true
tags: ["1.0.0", latest]
---
kind: pipeline # 定义一个管道
type: docker # 当前管道的类型
name: deploy # 当前管道的名称
depends_on:
- build
clone:
disable: true
steps:
- name: deploy-project
image: appleboy/drone-ssh
settings:
host:
from_secret: host
username:
from_secret: server_username # 使用secrets
key:
from_secret: server_key
port: 22
command_timeout: 2m
secrets: [docker_username, docker_passwd]
script:
- echo ==-----==开始部署==-----==
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWD git.liliyamol.cn:8081
- docker pull git.liliyamol.cn:8081/mol/searxng:latest
- list=$(docker ps -a | grep searxng* | awk '{print $1}')
- test "$list" = "" && echo "none searxng containers running" || docker stop $list && docker container rm $list
# 过滤出dockerImages的id, 删除none镜像
- docker run -d -p 12320:8080 -v /mnt/data/opt/searxng:/etc/searxng --restart=always --name=searxng git.liliyamol.cn:8081/mol/searxng:latest
- docker rmi $(docker images | grep "none" | awk '{print $3}')
- echo ==-----==部署成功==-----==

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM searxng/searxng:latest
EXPOSE 8080
WORKDIR /usr/local/searxng
COPY . .
RUN cp ./custom-searx-engines/engines/* ./searx/engines/
RUN pip install -r ./custom-searx-engines/requirements.txt
ENTRYPOINT /usr/local/searxng/dockerfiles/docker-entrypoint.sh

View File

@ -1,2 +1,3 @@
# custom-searx-engines # custom-searxng
> 自定义 searxng