From aab1411bbf3f1ab281c1151b3f448267792a8a84 Mon Sep 17 00:00:00 2001 From: Logan Koester Date: Sun, 12 Dec 2021 01:05:11 +0700 Subject: [PATCH] Build with smaug-docker via drone, then deploy by waypoint --- .drone.yml | 47 +++++++++++++++++++++++++++++++++++++++++++---- Dockerfile | 6 ++++++ Smaug.toml | 2 +- nginx.conf | 12 ++++++++++++ 4 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 Dockerfile create mode 100644 nginx.conf diff --git a/.drone.yml b/.drone.yml index 753b21d..896c5cc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,17 +4,27 @@ kind: pipeline type: docker name: Waypoint -workspace: - path: /drone/workspace +#workspace: +# path: /drone/workspace image_pull_secrets: - dockerconfig steps: - 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: - - 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 image: hashicorp/waypoint:latest @@ -30,6 +40,35 @@ steps: - waypoint deploy -remote -release=false - 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: branch: - master diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e55fed3 --- /dev/null +++ b/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 diff --git a/Smaug.toml b/Smaug.toml index 7745c1d..828addc 100644 --- a/Smaug.toml +++ b/Smaug.toml @@ -9,7 +9,7 @@ icon = "metadata/icon.png" compile_ruby = false [dragonruby] -version = "3.0" +version = "2.26" edition = "pro" [dependencies] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..1a085c3 --- /dev/null +++ b/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; + } +}