Browse Source
Build with smaug-docker via drone, then deploy by waypoint
master
No known key found for this signature in database
GPG Key ID: EBA7BD5CB8B7CB94
4 changed files with
62 additions and
5 deletions
-
.drone.yml
-
Dockerfile
-
Smaug.toml
-
nginx.conf
|
@ -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 |
|
|
|
@ -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 |
|
@ -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] |
|
|
|
@ -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; |
|
|
|
|
|
} |
|
|
|
|
|
} |