Add custom/start.sh
This commit is contained in:
		
							
								
								
									
										28
									
								
								custom/start.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								custom/start.sh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,28 @@ | |||||||
|  | #!/bin/bash | ||||||
|  |  | ||||||
|  | # This is the start.sh file for the gitea-runner egg | ||||||
|  |  | ||||||
|  | # Only download and set up act_runner if it doesn't exist | ||||||
|  | if [ ! -f "act_runner" ]; then | ||||||
|  |     echo "Downloading act_runner..." | ||||||
|  |     curl -O https://dl.gitea.com/act_runner/0.2.13/act_runner-0.2.13-linux-amd64 | ||||||
|  |     mv act_runner-0.2.13-linux-amd64 act_runner | ||||||
|  |     chmod +x act_runner | ||||||
|  |     echo "act_runner downloaded and set up." | ||||||
|  | else | ||||||
|  |     echo "act_runner already exists, skipping download." | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | # Only register if the config file (.runner) doesn't exist | ||||||
|  | if [ ! -f "config.yml" ]; then | ||||||
|  |     echo "Registering act_runner..." | ||||||
|  |     curl -O  | ||||||
|  |     ./act_runner generate-config > config.yaml register --instance ${INSTANCE_URL} --token ${RUNNER_TOKEN} --no-interactive  | ||||||
|  |     echo "Registration complete." | ||||||
|  | else | ||||||
|  |     echo "Config file (.runner) already exists, skipping registration." | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | # Always start the daemon | ||||||
|  | echo "Starting act_runner daemon..." | ||||||
|  | ./act_runner daemon | ||||||
		Reference in New Issue
	
	Block a user