Skip to content

Commit

Permalink
Merge branch 'main' into registry
Browse files Browse the repository at this point in the history
  • Loading branch information
eveld committed Apr 29, 2024
2 parents cdaf33e + ac19847 commit e2872cb
Show file tree
Hide file tree
Showing 13 changed files with 418 additions and 1,081 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_and_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
'/certificates',
'/terraform',
'/registries',
"/copy"
]

steps:
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The following snippets are examples of things you can build with Jumppad, for mo

```hcl
resource "network" "cloud" {
subnet = "10.5.0.0/16"
subnet = "10.5.0.0/24"
}
resource "k8s_cluster" "k3s" {
Expand All @@ -56,7 +56,7 @@ resource "k8s_cluster" "k3s" {
}
resource "k8s_config" "fake_service" {
cluster = resource.k8s_cluster.k3s.id
cluster = resource.k8s_cluster.k3s
paths = ["./fake_service.yaml"]
Expand All @@ -67,7 +67,7 @@ resource "k8s_config" "fake_service" {
}
resource "helm" "vault" {
cluster = resource.k8s_cluster.k3s.id
cluster = resource.k8s_cluster.k3s
repository {
name = "hashicorp"
Expand All @@ -89,7 +89,7 @@ resource "ingress" "vault_http" {
port = 18200
target {
id = resource.k8s_cluster.k3s.id
resource = resource.k8s_cluster.k3s
port = 8200
config = {
Expand All @@ -103,7 +103,7 @@ resource "ingress" "fake_service" {
port = 19090
target {
id = resource.k8s_cluster.k3s.id
resource = resource.k8s_cluster.k3s
port = 9090
config = {
Expand Down Expand Up @@ -139,7 +139,7 @@ resource "nomad_cluster" "dev" {
}
resource "nomad_job" "example_1" {
cluster = resource.nomad_cluster.dev.id
cluster = resource.nomad_cluster.dev
paths = ["./app_config/example1.nomad"]
Expand All @@ -153,7 +153,7 @@ resource "ingress" "fake_service_1" {
port = 19090
target {
id = resource.nomad_cluster.dev.id
resource = resource.nomad_cluster.dev
named_port = "http"
config = {
Expand Down
1 change: 1 addition & 0 deletions examples/copy/files/foo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bar
25 changes: 25 additions & 0 deletions examples/copy/main.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
resource "copy" "local" {
source = "${dir()}/files/foo"
destination = "${data("copy")}/local"
}

resource "copy" "local_relative" {
source = "./files/foo"
destination = "${data("copy")}/local_relative"
}


resource "copy" "http" {
source = "https://www.foundanimals.org/wp-content/uploads/2023/02/twenty20_b4e89a76-af70-4567-b92a-9c3bbf335cb3.jpg"
destination = "${data("copy")}/http"
}

resource "copy" "git" {
source = "github.com/jumppad-labs/examples"
destination = "${data("copy")}/git"
}

resource "copy" "zip" {
source = "https://releases.hashicorp.com/nomad/1.6.3/nomad_1.6.3_linux_amd64.zip"
destination = "${data("copy")}/zip"
}
27 changes: 27 additions & 0 deletions examples/copy/test/copy.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Feature: Copying files
In order to test copy capabilities
I should apply a blueprint
And check that the files have been copied

Scenario: Copy files from multiple sources
Given I have a running blueprint
When I run the script
```
#!/bin/bash
if [ ! -f $HOME/.jumppad/data/copy/local/foo ]; then
exit 1
fi

if [ ! -f $HOME/.jumppad/data/copy/http/twenty20_b4e89a76-af70-4567-b92a-9c3bbf335cb3.jpg ]; then
exit 1
fi

if [ ! -f $HOME/.jumppad/data/copy/git/README.md ]; then
exit 1
fi

if [ ! -f $HOME/.jumppad/data/copy/zip/nomad ]; then
exit 1
fi
```
Then I expect the exit code to be 0
2 changes: 2 additions & 0 deletions examples/functions/container.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ resource "container" "consul" {
cluster_api = cluster_api("nomad_cluster.dc1")
cluster_port = cluster_port("nomad_cluster.dc1")
var_len = len(variable.test_var)
os = system("os")
arch = system("arch")
}
}

0 comments on commit e2872cb

Please sign in to comment.