-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
61 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Setup Nomad | ||
description: Setup Local Nomad cluster for use in GitHub Actions | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Start Nomad cluster in container | ||
run: | | ||
docker run -d \ | ||
--name nomad-cluster \ | ||
-p 4646:4646 \ | ||
multani/nomad:latest | ||
shell: bash | ||
|
||
# Wait for the Nomad cluster to be ready | ||
- name: Wait for Nomad to start | ||
run: | | ||
for i in {1..10}; do | ||
if docker exec nomad-cluster nomad node status &> /dev/null; then | ||
echo "Nomad is ready" | ||
exit 0 | ||
fi | ||
echo "Waiting for Nomad to be ready..." | ||
sleep 3 | ||
done | ||
echo "Nomad did not start in time" >&2 | ||
exit 1 | ||
shell: bash | ||
|
||
post: | ||
- name: Stop and remove Nomad container | ||
run: | | ||
docker stop nomad-cluster | ||
docker rm nomad-cluster | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package nomad | ||
|
||
func stringPtr(s string) *string { | ||
return &s | ||
} | ||
|
||
func intToPtr(i int) *int { | ||
return &i | ||
} |