diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..48c52a6 --- /dev/null +++ b/.drone.yml @@ -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== diff --git a/.gitignore b/.gitignore index 92ffbce..c6c3f5a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ exceptions/ last_replay.txt replay.txt .DS_Store +.secrets diff --git a/.smaugignore b/.smaugignore index a1fd452..40d6a36 100644 --- a/.smaugignore +++ b/.smaugignore @@ -21,3 +21,6 @@ index.html *.md exceptions .DS_Store +.drone.yml +.secrets +waypoint.hcl diff --git a/waypoint.hcl b/waypoint.hcl new file mode 100644 index 0000000..7367c67 --- /dev/null +++ b/waypoint.hcl @@ -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" +}