Logan Koester
3 years ago
4 changed files with 94 additions and 0 deletions
@ -0,0 +1,37 @@ |
|||||
|
--- |
||||
|
|
||||
|
kind: pipeline |
||||
|
type: docker |
||||
|
name: Waypoint |
||||
|
|
||||
|
workspace: |
||||
|
path: /drone/workspace |
||||
|
|
||||
|
steps: |
||||
|
- name: build |
||||
|
image: hashicorp/waypoint:latest |
||||
|
environment: |
||||
|
WAYPOINT_SERVER_TOKEN: |
||||
|
from_secret: WAYPOINT_SERVER_TOKEN |
||||
|
WAYPOINT_SERVER_ADDR: waypoint.smaug.dev:9701 |
||||
|
WAYPOINT_SERVER_TLS: 1 |
||||
|
WAYPOINT_SERVER_TLS_SKIP_VERIFY: 1 |
||||
|
commands: |
||||
|
- waypoint init |
||||
|
- waypoint build -remote |
||||
|
- waypoint deploy -remote -release=false |
||||
|
- waypoint release -remote -prune-retain=0 |
||||
|
|
||||
|
trigger: |
||||
|
branch: |
||||
|
- master |
||||
|
- main |
||||
|
event: |
||||
|
- push |
||||
|
- pull_request |
||||
|
|
||||
|
--- |
||||
|
|
||||
|
kind: secret |
||||
|
name: WAYPOINT_SERVER_TOKEN |
||||
|
data: yYSmJ+ShC0BcgGptRBVK2pbdagqE+N03A5++izgkwIgs1IyHIDfpzrdtlVtkvMHAnw== |
@ -0,0 +1,53 @@ |
|||||
|
# The name of your project. A project typically maps 1:1 to a VCS repository. |
||||
|
# This name must be unique for your Waypoint server. If you're running in |
||||
|
# local mode, this must be unique to your machine. |
||||
|
project = "smaug_project_template" |
||||
|
|
||||
|
runner { |
||||
|
enabled = true |
||||
|
data_source "git" { |
||||
|
url = "https://git.smaug.dev/ereborstudios/smaug_project_template.git" |
||||
|
ref = "master" |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
# Labels can be specified for organizational purposes. |
||||
|
# labels = { "foo" = "bar" } |
||||
|
|
||||
|
# An application to deploy. |
||||
|
app "smaug_project_template" { |
||||
|
|
||||
|
config { |
||||
|
env = { |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
labels = { |
||||
|
"service" = var.name |
||||
|
} |
||||
|
|
||||
|
# Build specifies how an application should be deployed. In this case, |
||||
|
# we'll build using a Dockerfile and keeping it in a local registry. |
||||
|
build { |
||||
|
use "docker" { |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
# Deploy to Docker |
||||
|
deploy { |
||||
|
use "docker" { |
||||
|
labels = { |
||||
|
"traefik.http.routers.${var.name}.rule" = "Host(`${var.name}.waypoint.smaug.dev`)" |
||||
|
"traefik.http.routers.${var.name}.entrypoints" = "websecure" |
||||
|
"traefik.http.routers.${var.name}.tls.certresolver" = "myresolver" |
||||
|
"traefik.http.services.${var.name}.loadbalancer.server.port" = "3000" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
variable "name" { |
||||
|
type = string |
||||
|
default = "smaug_project_template" |
||||
|
description = "Project name" |
||||
|
} |
Loading…
Reference in new issue