File tree Expand file tree Collapse file tree 2 files changed +27
-6
lines changed Expand file tree Collapse file tree 2 files changed +27
-6
lines changed Original file line number Diff line number Diff line change 1
1
# Script-Runner
2
- It will run script from any public url.
2
+ It will run script from any public url or local file .
3
3
4
4
## Environment Variables:
5
5
- ` SCRIPT_URL ` : Is used to specify script url.
6
+ - ` SCRIPT_PATH ` : Is used to specify local script file.
6
7
7
8
## How to use?
8
- ### In Docker:
9
+ ### Using Docker:
10
+ - Create ` Dockerfile `
11
+ ```
12
+ FROM techthinkerorg/script-runner:1.1.0
13
+ WORKDIR /script
14
+ COPY ./your-script.sh /script/
15
+ ENV SCRIPT_PATH "your-script.sh"
16
+ ```
17
+ or
18
+ ```
19
+ FROM techthinkerorg/script-runner:1.1.0
20
+ ENV SCRIPT_URL "script-location-url.sh"
21
+ ```
22
+ - Run ` docker build -f ./Dockerfile -t your-image-name . `
23
+ - Run ` docker run your-image-name `
24
+
25
+ ### Using Docker Compose:
9
26
- Create ` docker-compose.yaml `
10
27
``` yaml
11
28
version : " 3"
12
29
services :
13
30
script :
14
31
container_name : script-runner
15
- image : techthinkerorg/script-runner:1.0 .0
32
+ image : techthinkerorg/script-runner:1.1 .0
16
33
environment :
17
34
- SCRIPT_URL=script-location-url.sh
18
35
` ` `
19
36
- Run compose file ` docker-compose up`
20
37
21
- # ## In Kubernetes:
38
+ # ## Using Kubernetes:
22
39
- Create `your-deployment-corn.yaml`
23
40
` ` ` yaml
24
41
apiVersion: batch/v1beta1
34
51
spec:
35
52
containers:
36
53
- name: your-deployment-cron
37
- image: techthinkerorg/script-runner:1.0 .0
54
+ image: techthinkerorg/script-runner:1.1 .0
38
55
env:
39
56
- name: SCRIPT_URL
40
57
value: "script-location-url.sh"
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- curl -sS -X GET " ${SCRIPT_URL} " | sh
2
+ if [[ -z " ${SCRIPT_URL} " ]]; then
3
+ cat " ${SCRIPT_PATH} " | sh
4
+ else
5
+ curl -sS -X GET " ${SCRIPT_URL} " | sh
6
+ fi
You can’t perform that action at this time.
0 commit comments