Skip to content

Commit 3ccb1fd

Browse files
committed
add git examples
1 parent 685f5ce commit 3ccb1fd

File tree

13 files changed

+101
-0
lines changed

13 files changed

+101
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
some data
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"packages": [],
3+
"shell": {
4+
"init_hook": [
5+
"echo 'Welcome to devbox!' > /dev/null"
6+
],
7+
"scripts": {
8+
"run_test": [
9+
"./test.sh"
10+
]
11+
}
12+
},
13+
"include": [
14+
"git+ssh://git@github.com/jetify-com/devbox-plugin-example.git?rev=d9c00334353c9b1294c7bd5dbea128c149b2eb3a"
15+
]
16+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"lockfile_version": "1",
3+
"packages": {}
4+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
expected="I AM SET"
4+
if [ "$MY_ENV_VAR" == "$expected" ]; then
5+
echo "Success! MY_ENV_VAR is set to '$MY_ENV_VAR'"
6+
else
7+
echo "MY_ENV_VAR environment variable is not set to '$expected'"
8+
exit 1
9+
fi
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
some data
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
some data

examples/plugins/git/devbox.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"packages": [],
3+
"shell": {
4+
"init_hook": [
5+
"echo 'Welcome to devbox!' > /dev/null"
6+
],
7+
"scripts": {
8+
"run_test": [
9+
"./test.sh"
10+
]
11+
}
12+
},
13+
"include": [
14+
"git+ssh://git@github.com/jetify-com/devbox-plugin-example.git",
15+
"git+https://github.com/jetify-com/devbox-plugin-example.git?dir=custom-dir",
16+
"git+https://github.com/jetify-com/devbox-plugin-example.git?ref=test/branch"
17+
]
18+
}

examples/plugins/git/devbox.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"lockfile_version": "1",
3+
"packages": {}
4+
}

examples/plugins/git/test.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
expected="I AM SET (new value)"
4+
custom_expected="I AM SET TO CUSTOM (new value)"
5+
if [ "$MY_ENV_VAR" == "$expected" ] && [ "$MY_ENV_VAR_CUSTOM" == "$custom_expected" ]; then
6+
echo "Success! MY_ENV_VAR is set to '$MY_ENV_VAR'"
7+
echo "Success! MY_ENV_VAR_CUSTOM is set to '$MY_ENV_VAR_CUSTOM'"
8+
else
9+
echo "ERROR: MY_ENV_VAR environment variable is not set to '$expected' OR MY_ENV_VAR_CUSTOM variable is not set to '$custom_expected'"
10+
exit 1
11+
fi
12+
13+
echo BRANCH_ENV_VAR=$BRANCH_ENV_VAR
14+
if [ "$BRANCH_ENV_VAR" != "I AM A BRANCH VAR" ]; then exit 1; fi;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
some data

0 commit comments

Comments
 (0)