Merge branch 'development_hetzner' into development_fix_ci
This commit is contained in:
37
examples/threefold/tfgrid3deployer/hetzner/hetzner.vsh
Normal file
37
examples/threefold/tfgrid3deployer/hetzner/hetzner.vsh
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/env -S v -gc none -no-retry-compilation -d use_openssl -enable-globals -cg run
|
||||||
|
|
||||||
|
//#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals -cg run
|
||||||
|
import freeflowuniverse.herolib.threefold.gridproxy
|
||||||
|
import freeflowuniverse.herolib.threefold.tfgrid3deployer
|
||||||
|
import freeflowuniverse.herolib.installers.threefold.griddriver
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
|
||||||
|
griddriver.install()!
|
||||||
|
|
||||||
|
v := tfgrid3deployer.get()!
|
||||||
|
println('cred: ${v}')
|
||||||
|
deployment_name := 'herzner_dep'
|
||||||
|
mut deployment := tfgrid3deployer.new_deployment(deployment_name)!
|
||||||
|
|
||||||
|
// TODO: find a way to filter hetzner nodes
|
||||||
|
deployment.add_machine(
|
||||||
|
name: 'hetzner_vm'
|
||||||
|
cpu: 1
|
||||||
|
memory: 2
|
||||||
|
planetary: false
|
||||||
|
public_ip4: true
|
||||||
|
size: 10 // 10 gig
|
||||||
|
mycelium: tfgrid3deployer.Mycelium{}
|
||||||
|
)
|
||||||
|
deployment.deploy()!
|
||||||
|
|
||||||
|
vm1 := deployment.vm_get('hetzner_vm')!
|
||||||
|
println('vm1 info: ${vm1}')
|
||||||
|
|
||||||
|
vm1_public_ip4 := vm1.public_ip4.all_before('/')
|
||||||
|
|
||||||
|
deployment.add_webname(name: 'gwtohetzner', backend: 'http://${vm1_public_ip4}:80')
|
||||||
|
deployment.deploy()!
|
||||||
|
gw1 := deployment.webname_get('gwtohetzner')!
|
||||||
|
println('gw info: ${gw1}')
|
||||||
Reference in New Issue
Block a user