forked from ZHoob2004/rusefi-ci
-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
b752767
commit 2030686
Showing
6 changed files
with
70 additions
and
41 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 |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#!/bin/bash | ||
echo "--------------------------------------------------------------" | ||
echo "Step 1/5, OS setup" | ||
|
||
source scripts/01_setup_OS.sh || { exit 1; } | ||
echo "--------------------------------------------------------------" | ||
|
||
echo "--------------------------------------------------------------" | ||
echo "Step 2/5, pulling/creating base runner container" | ||
|
||
source scripts/02_setup_runner_container.sh || { exit 1; } | ||
|
||
echo "--------------------------------------------------------------" | ||
echo "Step 3/5, updating udev rules" | ||
source scripts/03_setup_udev_rules.sh || { exit 1; } | ||
|
||
echo "--------------------------------------------------------------" | ||
echo "Step 4/5, select rusefi board for the runner" | ||
source scripts/04_clone_rusefi_board_definitions.sh || { exit 1; } | ||
|
||
echo "--------------------------------------------------------------" | ||
echo "Step 5/5, create the runner" | ||
source scripts/05_create_new_runner.sh || { exit 1; } |
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
#!/bin/bash | ||
|
||
docker pull ghcr.io/fdsoftware/rusefi-ci | ||
# should build the image locally if the pull fails? | ||
#docker build --build-arg GID=$(getent group docker | cut -d ':' -f 3) -t rusefi-ci . | ||
if docker pull ghcr.io/fdsoftware/rusefi-ci:main; then | ||
echo "remote docker container pull succeeded" | ||
else | ||
echo "remote docker container pull failed, building image locally" | ||
docker build --build-arg GID=$(getent group docker | cut -d ':' -f 3) -t rusefi-ci:main . | ||
fi |
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,14 @@ | ||
#!/bin/bash | ||
|
||
if [ -e "/etc/udev/rules.d/70-rusefi.rules" ]; then | ||
echo "creating udev rules" | ||
cat >/etc/udev/rules.d/70-rusefi.rules <<EOL | ||
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", GROUP="docker" | ||
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", GROUP="docker" | ||
EOL | ||
sudo service udev restart | ||
|
||
else | ||
echo "skipping, udev rules already installed" | ||
|
||
fi |
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 was deleted.
Oops, something went wrong.
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,37 @@ | ||
#!/bin/bash | ||
|
||
LABEL=${2:-"ubuntu-latest"} | ||
IMAGE_HASH=$(docker image inspect rusefi-ci --format "{{.Id}}" 2>/dev/null) | ||
|
||
read -p "Enter the rusEFI board serial ID: " HARDWARE_CI_SERIAL | ||
read -p "Enter the STLink ID: " HARDWARE_CI_STLINK_SERIAL | ||
read -p "Enter the CI VBATT: " HARDWARE_CI_VBATT | ||
|
||
echo "go to: https://github.com/FDSoftware/rusefi/settings/actions/runners/new and get a new runner token" | ||
read -p "Enter your runner token: " RUNNER_TOKEN | ||
|
||
DOCKER_RUNNER_IMAGE=$(docker images | grep -ioh "\S*rusefi-ci\S*" | head -1) | ||
|
||
if CONTAINER_HASH=$(docker container inspect $RUNNER_NAME --format "{{.Image}}" 2>/dev/null) && [ "$IMAGE_HASH" = "$CONTAINER_HASH" ]; then | ||
echo "There is already a runner with the same configuration, skipping" | ||
docker start -i "$RUNNER_NAME" | ||
else | ||
if docker container inspect "$RUNNER_NAME" >/dev/null 2>/dev/null; then | ||
echo "existing runner but there is a more recent base image, recreating" | ||
docker rm "$RUNNER_NAME" | ||
fi | ||
if [ -n "$3" ]; then | ||
MOUNT="-v $PWD/$3:/opt/actions-runner/rusefi-env:ro" | ||
fi | ||
|
||
#TODO: remove references to personal repo | ||
docker run --name $RUNNER_NAME --detach --privileged --restart=unless-stopped $MOUNT \ | ||
-e RUNNER_NAME="$RUNNER_NAME" \ | ||
-e RUNNER_LABELS="$LABEL" \ | ||
-e RUNNER_TOKEN="$RUNNER_TOKEN" \ | ||
-e HARDWARE_CI_SERIAL="$HARDWARE_CI_SERIAL" \ | ||
-e HARDWARE_CI_STLINK_SERIAL="$HARDWARE_CI_STLINK_SERIAL" \ | ||
-e HARDWARE_CI_VBATT="$HARDWARE_CI_VBATT" \ | ||
-e RUNNER_REPOSITORY_URL=https://github.com/FDSoftware/rusefi \ | ||
"$DOCKER_RUNNER_IMAGE:main" | ||
fi |