@ -0,0 +1,90 @@ |
|||||
|
--- |
||||
|
|
||||
|
kind: pipeline |
||||
|
type: docker |
||||
|
name: Waypoint |
||||
|
|
||||
|
#workspace: |
||||
|
# path: /drone/workspace |
||||
|
|
||||
|
image_pull_secrets: |
||||
|
- dockerconfig |
||||
|
|
||||
|
steps: |
||||
|
- name: build |
||||
|
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: |
||||
|
- sleep 5 # give docker enough time to start |
||||
|
- docker login -u $REGISTRY_TOKEN -p $REGISTRY_TOKEN $REGISTRY_URL |
||||
|
- addgroup --gid 1000 user |
||||
|
- adduser -D -g '' -G user -u 1000 user |
||||
|
- chown -R user:user /drone/src |
||||
|
- docker run -v /drone/src/:/app/src/ --rm $REGISTRY_URL/smaug/smaug:latest build |
||||
|
|
||||
|
- name: waypoint_deploy |
||||
|
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: |
||||
|
- pwd |
||||
|
- ls -la |
||||
|
- waypoint init |
||||
|
- waypoint build |
||||
|
- waypoint deploy -release=false |
||||
|
- waypoint release -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 |
||||
|
- main |
||||
|
event: |
||||
|
- push |
||||
|
- pull_request |
||||
|
- custom |
||||
|
|
||||
|
--- |
||||
|
|
||||
|
kind: secret |
||||
|
name: WAYPOINT_SERVER_TOKEN |
||||
|
data: yYSmJ+ShC0BcgGptRBVK2pbdagqE+N03A5++izgkwIgs1IyHIDfpzrdtlVtkvMHAnw== |
@ -0,0 +1,7 @@ |
|||||
|
builds/ |
||||
|
logs/ |
||||
|
exceptions/ |
||||
|
last_replay.txt |
||||
|
replay.txt |
||||
|
.DS_Store |
||||
|
.secrets |
@ -0,0 +1,26 @@ |
|||||
|
.gitkeep |
||||
|
.gitlab-ci.yml |
||||
|
.rspec |
||||
|
.github/ |
||||
|
.gitignore |
||||
|
.rubocop.yml |
||||
|
.travis.yml |
||||
|
.do/ |
||||
|
.smaugignore |
||||
|
Rakefile |
||||
|
Gemfile |
||||
|
Gemfile.lock |
||||
|
*.gemspec |
||||
|
smaug/**/bin/ |
||||
|
smaug/**/spec/ |
||||
|
smaug/**/samples/ |
||||
|
logs/ |
||||
|
builds/ |
||||
|
dist/ |
||||
|
index.html |
||||
|
*.md |
||||
|
exceptions |
||||
|
.DS_Store |
||||
|
.drone.yml |
||||
|
.secrets |
||||
|
waypoint.hcl |
@ -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 |
@ -0,0 +1,9 @@ |
|||||
|
MIT License |
||||
|
|
||||
|
Copyright (c) 2022 ldk |
||||
|
|
||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
||||
|
|
||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||
|
|
||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@ -0,0 +1,5 @@ |
|||||
|
# ornraier-candidacy |
||||
|
|
||||
|
> A new Smaug project |
||||
|
|
||||
|
--- |
@ -0,0 +1,22 @@ |
|||||
|
[project] |
||||
|
# The name of your game's executable. This should only contain a-z, A-Z, 0-9, _ or -. |
||||
|
name = "ornraier_candidacy" |
||||
|
# The game's title. This will show up in the tile bar of your executable. |
||||
|
title = "Ornraier-Candidacy" |
||||
|
version = "0.1.0" |
||||
|
authors = ["TODO: ldk <todo@example.com>"] |
||||
|
icon = "metadata/icon.png" |
||||
|
compile_ruby = false |
||||
|
|
||||
|
[dragonruby] |
||||
|
version = "2.26" |
||||
|
edition = "pro" |
||||
|
|
||||
|
[dependencies] |
||||
|
|
||||
|
[itch] |
||||
|
# The Project URL you set when you created the game on Itch.io. https://my-username.itch.io/my-game. |
||||
|
# This will also be the name of your build files, so fill it out even if you aren't uploading to Itch.io. |
||||
|
url = "todo-change-me" |
||||
|
# Your username on Itch.io. |
||||
|
username = "todo-change-me" |
@ -0,0 +1,7 @@ |
|||||
|
require 'smaug.rb' |
||||
|
|
||||
|
def tick args |
||||
|
args.outputs.labels << [640, 500, 'Ornraier-Candidacy', 5, 1] |
||||
|
args.outputs.labels << [640, 460, 'A new Smaug project', 5, 1] |
||||
|
args.outputs.sprites << [576, 280, 128, 101, 'dragonruby.png'] |
||||
|
end |
@ -0,0 +1,307 @@ |
|||||
|
# =============================================================== |
||||
|
# Welcome to repl.rb |
||||
|
# =============================================================== |
||||
|
# You can experiement with code within this file. Code in this |
||||
|
# file is only executed when you save (and only excecuted ONCE). |
||||
|
# =============================================================== |
||||
|
|
||||
|
# =============================================================== |
||||
|
# REMOVE the "x" from the word "xrepl" and save the file to RUN |
||||
|
# the code in between the do/end block delimiters. |
||||
|
# =============================================================== |
||||
|
|
||||
|
# =============================================================== |
||||
|
# ADD the "x" to the word "repl" (make it xrepl) and save the |
||||
|
# file to IGNORE the code in between the do/end block delimiters. |
||||
|
# =============================================================== |
||||
|
|
||||
|
# Remove the x from xrepl to run the code. Add the x back to ignore to code. |
||||
|
xrepl do |
||||
|
puts "The result of 1 + 2 is: #{1 + 2}" |
||||
|
end |
||||
|
|
||||
|
# ==================================================================================== |
||||
|
# Ruby Crash Course: |
||||
|
# Strings, Numeric, Booleans, Conditionals, Looping, Enumerables, Arrays |
||||
|
# ==================================================================================== |
||||
|
|
||||
|
# ==================================================================================== |
||||
|
# Strings |
||||
|
# ==================================================================================== |
||||
|
# Remove the x from xrepl to run the code. Add the x back to ignore to code. |
||||
|
xrepl do |
||||
|
message = "Hello World" |
||||
|
puts "The value of message is: " + message |
||||
|
puts "Any value can be interpolated within a string using \#{}." |
||||
|
puts "Interpolated message: #{message}." |
||||
|
puts 'This #{message} is not interpolated because the string uses single quotes.' |
||||
|
end |
||||
|
|
||||
|
# ==================================================================================== |
||||
|
# Numerics |
||||
|
# ==================================================================================== |
||||
|
# Remove the x from xrepl to run the code. Add the x back to ignore to code. |
||||
|
xrepl do |
||||
|
a = 10 |
||||
|
puts "The value of a is: #{a}" |
||||
|
puts "a + 1 is: #{a + 1}" |
||||
|
puts "a / 3 is: #{a / 3}" |
||||
|
end |
||||
|
|
||||
|
# Remove the x from xrepl to run the code. Add the x back to ignore to code. |
||||
|
xrepl do |
||||
|
b = 10.12 |
||||
|
puts "The value of b is: #{b}" |
||||
|
puts "b + 1 is: #{b + 1}" |
||||
|
puts "b as an integer is: #{b.to_i}" |
||||
|
puts '' |
||||
|
end |
||||
|
|
||||
|
# ==================================================================================== |
||||
|
# Booleans |
||||
|
# ==================================================================================== |
||||
|
# Remove the x from xrepl to run the code. Add the x back to ignore to code. |
||||
|
xrepl do |
||||
|
c = 30 |
||||
|
puts "The value of c is #{c}." |
||||
|
|
||||
|
if c |
||||
|
puts "This if statement ran because c is truthy." |
||||
|
end |
||||
|
end |
||||
|
|
||||
|
# Remove the x from xrepl to run the code. Add the x back to ignore to code. |
||||
|
xrepl do |
||||
|
d = false |
||||
|
puts "The value of d is #{d}." |
||||
|
|
||||
|
if !d |
||||
|
puts "This if statement ran because d is falsey, using the not operator (!) makes d evaluate to true." |
||||
|
end |
||||
|
|
||||
|
e = nil |
||||
|
puts "Nil is also considered falsey. The value of e is: #{e}." |
||||
|
|
||||
|
if !e |
||||
|
puts "This if statement ran because e is nil (a falsey value)." |
||||
|
end |
||||
|
end |
||||
|
|
||||
|
# ==================================================================================== |
||||
|
# Conditionals |
||||
|
# ==================================================================================== |
||||
|
# Remove the x from xrepl to run the code. Add the x back to ignore to code. |
||||
|
xrepl do |
||||
|
i_am_true = true |
||||
|
i_am_nil = nil |
||||
|
i_am_false = false |
||||
|
i_am_hi = "hi" |
||||
|
|
||||
|
puts "======== if statement" |
||||
|
i_am_one = 1 |
||||
|
if i_am_one |
||||
|
puts "This was printed because i_am_one is truthy." |
||||
|
end |
||||
|
|
||||
|
puts "======== if/else statement" |
||||
|
if i_am_false |
||||
|
puts "This will NOT get printed because i_am_false is false." |
||||
|
else |
||||
|
puts "This was printed because i_am_false is false." |
||||
|
end |
||||
|
|
||||
|
puts "======== if/elsif/else statement" |
||||
|
if i_am_false |
||||
|
puts "This will NOT get printed because i_am_false is false." |
||||
|
elsif i_am_true |
||||
|
puts "This was printed because i_am_true is true." |
||||
|
else |
||||
|
puts "This will NOT get printed i_am_true was true." |
||||
|
end |
||||
|
|
||||
|
puts "======== case statement " |
||||
|
i_am_one = 1 |
||||
|
case i_am_one |
||||
|
when 10 |
||||
|
puts "case equaled: 10" |
||||
|
when 9 |
||||
|
puts "case equaled: 9" |
||||
|
when 5 |
||||
|
puts "case equaled: 5" |
||||
|
when 1 |
||||
|
puts "case equaled: 1" |
||||
|
else |
||||
|
puts "Value wasn't cased." |
||||
|
end |
||||
|
|
||||
|
puts "======== different types of comparisons" |
||||
|
if 4 == 4 |
||||
|
puts "equal (4 == 4)" |
||||
|
end |
||||
|
|
||||
|
if 4 != 3 |
||||
|
puts "not equal (4 != 3)" |
||||
|
end |
||||
|
|
||||
|
if 3 < 4 |
||||
|
puts "less than (3 < 4)" |
||||
|
end |
||||
|
|
||||
|
if 4 > 3 |
||||
|
puts "greater than (4 > 3)" |
||||
|
end |
||||
|
|
||||
|
if ((4 > 3) || (3 < 4) || false) |
||||
|
puts "or statement ((4 > 3) || (3 < 4) || false)" |
||||
|
end |
||||
|
|
||||
|
if ((4 > 3) && (3 < 4)) |
||||
|
puts "and statement ((4 > 3) && (3 < 4))" |
||||
|
end |
||||
|
end |
||||
|
|
||||
|
# ==================================================================================== |
||||
|
# Looping |
||||
|
# ==================================================================================== |
||||
|
# Remove the x from xrepl to run the code. Add the x back to ignore to code. |
||||
|
xrepl do |
||||
|
puts "======== times block" |
||||
|
3.times do |i| |
||||
|
puts i |
||||
|
end |
||||
|
puts "======== range block exclusive" |
||||
|
(0...3).each do |i| |
||||
|
puts i |
||||
|
end |
||||
|
puts "======== range block inclusive" |
||||
|
(0..3).each do |i| |
||||
|
puts i |
||||
|
end |
||||
|
end |
||||
|
|
||||
|
# ==================================================================================== |
||||
|
# Enumerables |
||||
|
# ==================================================================================== |
||||
|
# Remove the x from xrepl to run the code. Add the x back to ignore to code. |
||||
|
xrepl do |
||||
|
puts "======== array each" |
||||
|
colors = ["red", "blue", "yellow"] |
||||
|
colors.each do |color| |
||||
|
puts color |
||||
|
end |
||||
|
|
||||
|
puts '======== array each_with_index' |
||||
|
colors = ["red", "blue", "yellow"] |
||||
|
colors.each_with_index do |color, i| |
||||
|
puts "#{color} at index #{i}" |
||||
|
end |
||||
|
end |
||||
|
|
||||
|
# Remove the x from xrepl to run the code. Add the x back to ignore to code. |
||||
|
xrepl do |
||||
|
puts "======== single parameter function" |
||||
|
def add_one_to n |
||||
|
n + 5 |
||||
|
end |
||||
|
|
||||
|
puts add_one_to(3) |
||||
|
|
||||
|
puts "======== function with default value" |
||||
|
def function_with_default_value v = 10 |
||||
|
v * 10 |
||||
|
end |
||||
|
|
||||
|
puts "passing three: #{function_with_default_value(3)}" |
||||
|
puts "passing nil: #{function_with_default_value}" |
||||
|
|
||||
|
puts "======== Or Equal (||=) operator for nil values" |
||||
|
def function_with_nil_default_with_local a = nil |
||||
|
result = a |
||||
|
result ||= "or equal operator was exected and set a default value" |
||||
|
end |
||||
|
|
||||
|
puts "passing 'hi': #{function_with_nil_default_with_local 'hi'}" |
||||
|
puts "passing nil: #{function_with_nil_default_with_local}" |
||||
|
end |
||||
|
|
||||
|
# ==================================================================================== |
||||
|
# Arrays |
||||
|
# ==================================================================================== |
||||
|
# Remove the x from xrepl to run the code. Add the x back to ignore to code. |
||||
|
xrepl do |
||||
|
puts "======== Create an array with the numbers 1 to 10." |
||||
|
one_to_ten = (1..10).to_a |
||||
|
puts one_to_ten |
||||
|
|
||||
|
puts "======== Create a new array that only contains even numbers from the previous array." |
||||
|
one_to_ten = (1..10).to_a |
||||
|
evens = one_to_ten.find_all do |number| |
||||
|
number % 2 == 0 |
||||
|
end |
||||
|
puts evens |
||||
|
|
||||
|
puts "======== Create a new array that rejects odd numbers." |
||||
|
one_to_ten = (1..10).to_a |
||||
|
also_even = one_to_ten.reject do |number| |
||||
|
number % 2 != 0 |
||||
|
end |
||||
|
puts also_even |
||||
|
|
||||
|
puts "======== Create an array that doubles every number." |
||||
|
one_to_ten = (1..10).to_a |
||||
|
doubled = one_to_ten.map do |number| |
||||
|
number * 2 |
||||
|
end |
||||
|
puts doubled |
||||
|
|
||||
|
puts "======== Create an array that selects only odd numbers and then multiply those by 10." |
||||
|
one_to_ten = (1..10).to_a |
||||
|
odd_doubled = one_to_ten.find_all do |number| |
||||
|
number % 2 != 0 |
||||
|
end.map do |odd_number| |
||||
|
odd_number * 10 |
||||
|
end |
||||
|
puts odd_doubled |
||||
|
|
||||
|
puts "======== All combination of numbers 1 to 10." |
||||
|
one_to_ten = (1..10).to_a |
||||
|
all_combinations = one_to_ten.product(one_to_ten) |
||||
|
puts all_combinations |
||||
|
|
||||
|
puts "======== All uniq combinations of numbers. For example: [1, 2] is the same as [2, 1]." |
||||
|
one_to_ten = (1..10).to_a |
||||
|
uniq_combinations = |
||||
|
one_to_ten.product(one_to_ten) |
||||
|
.map do |unsorted_number| |
||||
|
unsorted_number.sort |
||||
|
end.uniq |
||||
|
puts uniq_combinations |
||||
|
end |
||||
|
|
||||
|
# ==================================================================================== |
||||
|
# Advanced Arrays |
||||
|
# ==================================================================================== |
||||
|
# Remove the x from xrepl to run the code. Add the x back to ignore to code. |
||||
|
xrepl do |
||||
|
puts "======== All unique Pythagorean Triples between 1 and 40 sorted by area of the triangle." |
||||
|
|
||||
|
one_to_hundred = (1..40).to_a |
||||
|
triples = |
||||
|
one_to_hundred.product(one_to_hundred).map do |width, height| |
||||
|
[width, height, Math.sqrt(width ** 2 + height ** 2)] |
||||
|
end.find_all do |_, _, hypotenuse| |
||||
|
hypotenuse.to_i == hypotenuse |
||||
|
end.map do |triangle| |
||||
|
triangle.map(&:to_i) |
||||
|
end.uniq do |triangle| |
||||
|
triangle.sort |
||||
|
end.map do |width, height, hypotenuse| |
||||
|
[width, height, hypotenuse, (width * height) / 2] |
||||
|
end.sort_by do |_, _, _, area| |
||||
|
area |
||||
|
end |
||||
|
|
||||
|
triples.each do |width, height, hypotenuse, area| |
||||
|
puts "(#{width}, #{height}, #{hypotenuse}) = #{area}" |
||||
|
end |
||||
|
end |
@ -0,0 +1,29 @@ |
|||||
|
# For advanced users: |
||||
|
# You can put some quick verification tests here, any method |
||||
|
# that starts with the `test_` will be run when you save this file. |
||||
|
|
||||
|
# Here is an example test and game |
||||
|
|
||||
|
# To run the test: ./dragonruby mygame --eval app/tests.rb --no-tick |
||||
|
|
||||
|
class MySuperHappyFunGame |
||||
|
attr_gtk |
||||
|
|
||||
|
def tick |
||||
|
outputs.solids << [100, 100, 300, 300] |
||||
|
end |
||||
|
end |
||||
|
|
||||
|
def test_universe args, assert |
||||
|
game = MySuperHappyFunGame.new |
||||
|
game.args = args |
||||
|
game.tick |
||||
|
assert.true! args.outputs.solids.length == 1, "failure: a solid was not added after tick" |
||||
|
assert.false! 1 == 2, "failure: some how, 1 equals 2, the world is ending" |
||||
|
puts "test_universe completed successfully" |
||||
|
end |
||||
|
|
||||
|
puts "running tests" |
||||
|
$gtk.reset 100 |
||||
|
$gtk.log_level = :off |
||||
|
$gtk.tests.start |
@ -0,0 +1 @@ |
|||||
|
Put level data and other txt files here. |
@ -0,0 +1 @@ |
|||||
|
Put your custom fonts here. |
@ -0,0 +1,10 @@ |
|||||
|
# This file was automatically @generated by Smaug. |
||||
|
# Do not manually edit this file. Edit Smaug.toml instead. |
||||
|
|
||||
|
devid=todo-change-me |
||||
|
devtitle=TODO: ${REPO_OWNER} <todo@example.com> |
||||
|
gameid=${REPO_NAME_SNAKE} |
||||
|
gametitle=${REPO_NAME_TITLE} |
||||
|
version=0.1.0 |
||||
|
icon=metadata/icon.png |
||||
|
compile_ruby=false |
After Width: | Height: | Size: 153 KiB |
@ -0,0 +1,14 @@ |
|||||
|
# ios_metadata.txt is used by the Pro version of DragonRuby Game Toolkit to create iOS apps. |
||||
|
# Information about the Pro version can be found at: http://dragonruby.org/toolkit/game#purchase |
||||
|
|
||||
|
# teamname needs to be set to your assigned team id which can be found at https://developer.apple.com/account/#/membership/L7H57V9CRD |
||||
|
teamid= |
||||
|
# appid needs to be set to your application identifier which can be found at https://developer.apple.com/account/resources/identifiers/list |
||||
|
appid= |
||||
|
# appname is the name you want to show up underneath the app icon on the device |
||||
|
appname= |
||||
|
|
||||
|
# devcert is the certificate to use for development/deploying to your local device |
||||
|
devcert= |
||||
|
# prodcert is the certificate to use for distribution to the app store |
||||
|
prodcert= |
@ -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; |
||||
|
} |
||||
|
} |
@ -0,0 +1,4 @@ |
|||||
|
# This file was automatically @generated by Smaug. |
||||
|
# Do not manually edit this file. Edit Smaug.toml instead. |
||||
|
|
||||
|
|
@ -0,0 +1 @@ |
|||||
|
Put your sounds here. |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 267 B |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 2.5 KiB |
@ -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" |
||||
|
} |