Browse Source

Build with smaug-docker via drone, then deploy by waypoint

master
Logan Koester 3 years ago
parent
commit
aab1411bbf
No known key found for this signature in database GPG Key ID: EBA7BD5CB8B7CB94
  1. 47
      .drone.yml
  2. 6
      Dockerfile
  3. 2
      Smaug.toml
  4. 12
      nginx.conf

47
.drone.yml

@ -4,17 +4,27 @@ kind: pipeline
type: docker type: docker
name: Waypoint name: Waypoint
workspace: #workspace:
path: /drone/workspace # path: /drone/workspace
image_pull_secrets: image_pull_secrets:
- dockerconfig - dockerconfig
steps: steps:
- name: build - name: build
image: registry.digitalocean.com/smaug environment:
REGISTRY_URL: registry.digitalocean.com
REGISTRY_TOKEN:
from_secret: REGISTRY_TOKEN
image: docker:dind
volumes:
- name: dockersock
#path: /var/run/docker.sock
path: /var/run
commands: commands:
- smaug - sleep 5 # give docker enough time to start
- docker login -u $REGISTRY_TOKEN -p $REGISTRY_TOKEN $REGISTRY_URL
- docker run -v /drone/src/:/app/src/ --rm $REGISTRY_URL/smaug/smaug:latest build
- name: waypoint_deploy - name: waypoint_deploy
image: hashicorp/waypoint:latest image: hashicorp/waypoint:latest
@ -30,6 +40,35 @@ steps:
- waypoint deploy -remote -release=false - waypoint deploy -remote -release=false
- waypoint release -remote -prune-retain=0 - waypoint release -remote -prune-retain=0
- name: gitea_release
image: plugins/gitea-release
settings:
api_key:
from_secret: GITEA_API_KEY
base_url: https://git.smaug.dev
files:
- builds/*-html5.zip
checksum:
- sha512
when:
event:
- tag
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
#path: /var/run/docker.sock
path: /var/run
volumes:
- name: dockersock
temp: {}
#host:
#path: /var/run/docker.sock
trigger: trigger:
branch: branch:
- master - master

6
Dockerfile

@ -0,0 +1,6 @@
FROM nginx:alpine
COPY ./builds/*-html5.zip /tmp/
RUN unzip -d /var/www /tmp/*-html5.zip
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 3000

2
Smaug.toml

@ -9,7 +9,7 @@ icon = "metadata/icon.png"
compile_ruby = false compile_ruby = false
[dragonruby] [dragonruby]
version = "3.0" version = "2.26"
edition = "pro" edition = "pro"
[dependencies] [dependencies]

12
nginx.conf

@ -0,0 +1,12 @@
server {
listen 3000;
server_name _;
root /var/www/;
index index.html;
# Send all single page app paths to index.html
location / {
try_files $uri /index.html;
}
}
Loading…
Cancel
Save