|
1 | 1 | #!/bin/bash |
2 | 2 |
|
3 | | -RESEDGE_AUTOMATION_DOCKER_IMAGE="ghcr.io/cse-labs/res-edge-automation:0.9" |
| 3 | +# "ds cicd" use the Res-Edge Automation docker image and the Res-Edge Data Service |
| 4 | +# to generate GitOps manifest files for each Cluster |
4 | 5 |
|
5 | | -usage() { |
6 | | - echo "Usage: kic cicd [--show]" |
7 | | - exit 1 |
8 | | -} |
| 6 | +# Run "git status" to see the repo changes |
9 | 7 |
|
10 | | -# check the number of parameters |
11 | | -if [ $# -gt 1 ]; then |
12 | | - usage |
13 | | -fi |
14 | | - |
15 | | -# extract the first parameter into a variable |
16 | | -param="$1" |
17 | | - |
18 | | -# check if the parameter is valid |
19 | | -if [ $# -eq 1 ]; then |
20 | | - if [[ $param == "--show" ]]; then |
21 | | - show_flag=1 |
22 | | - else |
23 | | - usage |
24 | | - fi |
25 | | -fi |
26 | | - |
27 | | -# If the flag is set, show a message |
28 | | -if [[ $show_flag -eq 1 ]]; then |
29 | | - cat << EOF |
30 | | -Default Script |
31 | | -
|
32 | | -#!/bin/bash |
33 | | -
|
34 | | -# The following command will execute the ghcr.io/cse-labs/res-edge-automation image in docker |
35 | | -# and will mount the current directory into a working directory inside the container. |
36 | | -# The container will retrieve all required information from the dataservice |
37 | | -# and validate, create and/or update (as necessary) the clusters gitops manifest files |
38 | | -# in the working directory without pushing changes to remote repository. |
39 | | -
|
40 | | -docker run -it --rm \\ |
41 | | - --net host \\ |
42 | | - -v \$(pwd):/goa \\ |
43 | | - ${RESEDGE_AUTOMATION_DOCKER_IMAGE} \\ |
44 | | - -s "${DS_URL}" |
45 | | -EOF |
46 | | - exit |
47 | | -fi |
| 8 | +# The changes are not pushed to GitHub |
| 9 | +# use "ds deploy" to push any GitOps changes |
48 | 10 |
|
49 | 11 | echo "Running ci-cd locally ..." |
50 | 12 |
|
51 | | -# The following command will execute the ghcr.io/cse-labs/res-edge-automation image in docker |
52 | | -# and will mount the current directory into a working directory inside the container. |
53 | | -# The container will retrieve all required information from the dataservice |
54 | | -# and validate, create and/or update (as necessary) the clusters gitops manifest files |
55 | | -# in the working directory without pushing changes to remote repository. |
56 | 13 | docker run -it --rm \ |
57 | 14 | --net host \ |
58 | | - -v "$(pwd)":/goa \ |
59 | | - ${RESEDGE_AUTOMATION_DOCKER_IMAGE} \ |
| 15 | + -v "$KIC_BASE":/goa \ |
| 16 | + ghcr.io/cse-labs/res-edge-automation:0.9 \ |
60 | 17 | -s "${DS_URL}" |
0 commit comments