This commit is contained in:
		
							
								
								
									
										35
									
								
								.drone.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								.drone.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,35 @@
 | 
			
		||||
kind: pipeline
 | 
			
		||||
name: default
 | 
			
		||||
 | 
			
		||||
steps:
 | 
			
		||||
- name: docker
 | 
			
		||||
  image: plugins/docker
 | 
			
		||||
  settings:
 | 
			
		||||
    username:
 | 
			
		||||
      from_secret: hub_username
 | 
			
		||||
    password:
 | 
			
		||||
      from_secret: hub_password
 | 
			
		||||
    repo:
 | 
			
		||||
      from_secret: hub_repo
 | 
			
		||||
    tags: latest
 | 
			
		||||
  when:
 | 
			
		||||
    branch:
 | 
			
		||||
      - master
 | 
			
		||||
 | 
			
		||||
- name: notify
 | 
			
		||||
  image: appleboy/drone-telegram
 | 
			
		||||
  settings:
 | 
			
		||||
    token:
 | 
			
		||||
      from_secret: telegram_bot_token
 | 
			
		||||
    to:
 | 
			
		||||
      from_secret: telegram_group_id
 | 
			
		||||
    message: >
 | 
			
		||||
      {{#success build.status}}
 | 
			
		||||
        build {{build.link}} triggerd by {{commit.link}} from {{commit.author}} succeeded
 | 
			
		||||
      {{else}}
 | 
			
		||||
        build {{build.link}} triggerd by {{commit.link}} from {{commit.author}} failed
 | 
			
		||||
      {{/success}}
 | 
			
		||||
  when:
 | 
			
		||||
    status:
 | 
			
		||||
      - success
 | 
			
		||||
      - failure
 | 
			
		||||
							
								
								
									
										19
									
								
								DOCKER_DEPLOY.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								DOCKER_DEPLOY.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
# Drone docker deploy
 | 
			
		||||
 | 
			
		||||
## Użycie
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
cat ${args[0]} |awk -F\= '{system("drone secret add --repository='${args[1]}' --name="$1 "  --data="$2)}'
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Wymagane zmienne:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
hub_username=
 | 
			
		||||
hub_password=
 | 
			
		||||
hub_repo=
 | 
			
		||||
telegram_bot_token=
 | 
			
		||||
telegram_group_id=
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										33
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
FROM alpine:edge as builder
 | 
			
		||||
 | 
			
		||||
RUN apk --no-cache add cmake \ 
 | 
			
		||||
        clang \
 | 
			
		||||
        clang-dev \
 | 
			
		||||
        make \
 | 
			
		||||
        gcc \
 | 
			
		||||
        g++ \
 | 
			
		||||
        libc-dev \
 | 
			
		||||
        linux-headers \
 | 
			
		||||
        zlib-dev \
 | 
			
		||||
        git 
 | 
			
		||||
 | 
			
		||||
RUN \
 | 
			
		||||
  git clone git://github.com/lpereira/lwan && \
 | 
			
		||||
  cd lwan && \
 | 
			
		||||
  mkdir build && \
 | 
			
		||||
  cd build && \
 | 
			
		||||
  cmake .. -DCMAKE_BUILD_TYPE=Release && \
 | 
			
		||||
  make && \
 | 
			
		||||
  pwd
 | 
			
		||||
 | 
			
		||||
FROM alpine:edge 
 | 
			
		||||
 | 
			
		||||
COPY --from=builder /lwan/build/src/bin/lwan/ /opt/lwan
 | 
			
		||||
COPY lwan/lwan.conf /opt/lwan
 | 
			
		||||
 | 
			
		||||
WORKDIR /opt/lwan
 | 
			
		||||
EXPOSE 80 443 8080
 | 
			
		||||
VOLUME ["/opt/lwan", "/opt/lwan/wwwroot"]
 | 
			
		||||
 | 
			
		||||
ENTRYPOINT ["/opt/lwan/lwan"]
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										12
									
								
								lwan/lwan.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								lwan/lwan.conf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
keep_alive_timeout = 15
 | 
			
		||||
quiet = false
 | 
			
		||||
reuse_port = false
 | 
			
		||||
expires = 1M 1w
 | 
			
		||||
threads = 0
 | 
			
		||||
 | 
			
		||||
listener *:8080 {
 | 
			
		||||
   serve_files / {
 | 
			
		||||
            path = ./wwwroot
 | 
			
		||||
            serve precompressed files = true
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user