You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+49-43Lines changed: 49 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,69 +7,75 @@
7
7
8
8
Infused with cloud native capabilities from the moment you start, Appsody provides everything you need to iteratively develop applications, ready for deployment to Kubernetes environments. Teams are empowered with sharable technology stacks, configurable and controllable through a central hub.
9
9
10
-
# appsody-controller
11
-
The appsody-controller is an appsody process that runs inside the docker container, it does any preinstall required, starts the server with the command specified for run, debug or test mode, and watches for file changes, if configured to do so. If so configured, when file or directory changes occur it runs a an "ON_CHANGE" action specific to the mode.
10
+
# appsody-controller
11
+
The appsody-controller is an Appsody process that runs inside the Docker container. The controller does any preinstall required, starts the server with the command specified for run, debug or test mode, and watches for file changes, if configured to do so. If so configured, when file or directory changes occur it runs an "ON_CHANGE" action specific to the mode.
12
12
13
-
## Build Notes:
13
+
## Build Notes:
14
14
15
15
### Travis Build
16
-
The project is instrumented with Travis CI and with an appropriate Makefile. Most of the build logic is triggered from within the Makefile.
16
+
The project is instrumented with Travis CI and an appropriate Makefile. Most of the build logic is triggered from within the Makefile.
17
17
18
-
Upon commit, only the test and lint actions are executed by Travis.
18
+
Upon commit, only the `test` and `lint` actions are run by Travis.
19
19
20
-
In order for Travis to go all the way to package and deploy, you need to create a new release (one that is tagged with a never seen before tag). When you create a new release, a Travis build with automatically run, and the resulting artifacts will be posted on the Releases page.
20
+
In order for Travis to go all the way to package and deploy, you need to create a new release (one that is tagged with a never seen before tag). When you create a new release, a Travis build is automatically run, and the resulting artifacts are posted on the Releases page.
21
21
22
-
###Manual Build
22
+
###Manual Build
23
23
You can also test the build process manually.
24
24
25
-
After setting the GOPATH env var correctly, just run make <action...> from the command line, within the same directory where Makefile resides. For examplemake package clean will run the package and then the clean actions.
25
+
Set the `GOPATH` environment variable, then run `make <action...>` from the command line, within the directory that contains the makefile. For example, `make package clean` runs the package and then the clean actions.
26
26
27
-
example make commands:
28
-
29
-
make lint- Lints the files
30
-
make test - Automated test cases are run
31
-
make build - Builds binary in build dir of this folder
32
-
make package - Builds the linux binary and stores it in the package/ dir
27
+
Supported make commands include:
28
+
29
+
*`make lint`- Lints the files
30
+
*`make test` - Runs automated test cases
31
+
*`make build` - Builds the binary in the `build` directory
32
+
*`make package` - Builds the Linux binary and stores it in the `package` directory
33
33
34
34
## Where to find the latest binary build
35
35
36
-
[https://github.com/appsody/controller/releases]
36
+
[https://github.com/appsody/controller/releases]
37
37
38
-
The controller needs to be executable. Note that you may have to chmod the permissions to be executable.
38
+
The controller needs to be executable. Note you might have to chmod the permissions to be executable.
39
39
40
-
## Environment Variables
41
-
To use the controller, you must configure the relevant Dockerfile environment variables. For more information about the environment variables currently supported by Appsody, please see [here](https://appsody.dev/docs/stacks/environment-variables).
40
+
## Environment Variables
41
+
To use the controller, you must configure the relevant Dockerfile environment variables. For more information about the environment variables currently supported by Appsody, see [here](https://appsody.dev/docs/stacks/environment-variables).
42
42
43
43
## Running the controller for development:
44
44
45
-
Run the appsody-controller-vlatest (appsody-controller) command located in the build directory
45
+
Run the appsody-controller-vlatest (appsody-controller) command located in the build directory
46
46
47
47
There are two parameters -mode (--mode) and -debug (--debug)
48
48
49
-
__-mode__ controls which mode the controller runs in: run, debug or test.
49
+
__-mode__ controls which mode the controller runs in: run, debug, or test.
50
50
If the mode option is unspecified, the mode is assumed to be "run".
51
51
52
-
The options are as follows (note --mode and -mode are interchangeable):
53
-
>No value Mode is run
54
-
>--mode Mode is run
55
-
>--mode=debug Mode is debug
56
-
>--mode=test Mode is test
57
-
>--mode=run Mode is run
52
+
The options are as follows (note --mode and -mode are interchangeable):
53
+
54
+
| Mode flag | Description |
55
+
| ---- | ----------- |
56
+
| Not specified | Mode defaults to run |
57
+
| --mode | Mode is set to run |
58
+
| --mode=debug | Mode is set to debug |
59
+
| --mode=test | Mode is set to test |
60
+
| --mode=run | Mode is set to run |
58
61
59
62
__-v or -verbose__ controls whether debug level of logging is enabled.
60
-
If the mode is not specified it is assume to be false.
63
+
If the mode is not specified, it is assumed to be false.
64
+
65
+
This can be specified in several ways (note --verbose and -v are interchangeable):
61
66
62
-
This can be specified in several ways (note --verbose and -v are interchangeable):
63
-
>No value Debug logging is off
64
-
>--v Debug logging is on
65
-
>--v=false Debug logging is off
66
-
>--v=true Debug logging is on
67
+
| Verbose flag | Description |
68
+
| ------------ | ----------- |
69
+
| Not specified | Debug logging is off |
70
+
| --v | Debug logging is on |
71
+
| --v=false | Debug logging is off |
72
+
| --v=true | Debug logging is on |
67
73
68
-
--version returns the current version
74
+
__--version__ returns the current version
69
75
70
76
## The docker appsody/init-controller:{travis_tag} image
71
77
72
-
This image is built as part of the release/deploy process in travis.
78
+
This image is built as part of the release/deploy process in Travis.
73
79
This image contains a copy of the appsody-controller binary placed at the `/` directory of the image.
74
80
75
81
In addition, the Dockerfile contains a CMD that copies the controller binary to the /.appsody directory when the image is run by the Appsody CLI. The /.appsody directory is mounted on a volume known to the Appsody CLI:
@@ -78,22 +84,22 @@ In addition, the Dockerfile contains a CMD that copies the controller binary to
78
84
79
85
## Building a test init-controller docker image
80
86
81
-
The developer can build their own init-controller image to test with the CLI by using the build.sh script located at the root of this project.
87
+
The developer can build their own init-controller image to test with the CLI by using the `build.sh` script located at the root of this project.
82
88
83
-
Note that you must do make package prior to running the build.sh script as the Dockerfile will look for appsody-controller in the package directory.
89
+
Note that you must do `make package` prior to running the `build.sh` script as the Dockerfile will look for appsody-controller in the package directory.
84
90
85
91
Specify the following environment variables:
86
-
- TRAVIS_TAG
92
+
- TRAVIS_TAG
87
93
- DOCKER_ORG
88
94
- DOCKER_USERNAME
89
95
- DOCKER_PASSWORD
90
96
91
97
This will build the init-controller image locally and push it to the corresponding DOCKER_ORG/DOCKER_USERNAME/init-controller:{TRAVIS_TAG} docker repository location where it will also be tagged as 'latest'.
92
98
93
99
## Testing the controller with the Appsody CLI
94
-
The Appsody CLI makefile specifies a particular version of the appsody-controller. Which will cause a particular version of init-controller to be used.
100
+
The Appsody CLI makefile specifies a particular version of the appsody-controller that causes a particular version of init-controller to be used.
95
101
96
-
If a tester needs to test a different version of the controller with the CLI, there are two environment variables they can exported to test with a different version:
102
+
If a tester needs to test a different version of the controller with the Appsody CLI, there are two environment variables they can export to test with a different version:
97
103
98
104
APPSODY_CONTROLLER_VERSION will allow the tester to specify a different version of the appsody-controller, for instance 0.3.0 vs 0.3.1:
99
105
@@ -109,11 +115,11 @@ If both are specified, APPSODY_CONTROLLER_IMAGE will be used.
109
115
## Controller behavior
110
116
111
117
- As of release 0.2.4 only file related events will trigger ON_CHANGE actions by the controller. Directory events such as mkdir, rmdir, chmod, etc will not trigger ON_CHANGE actions.
112
-
- As of release 0.2.4 a potential problem with how events occuring in the APPSODY_WATCH_IGNORE_DIR are handled has been fixed. Such events are now pre processed by the watcher code, rather than post processed once the event reaches the controller.
118
+
- As of release 0.2.4 a potential problem with how events occuring in the APPSODY_WATCH_IGNORE_DIR are handled has been fixed. Such events are now preprocessed by the watcher code, rather than post processed once the event reaches the controller.
113
119
114
120
## Known issues
115
121
116
-
If the appsody stack of interest uses a script file (.sh for example) that is then edited by the `vi` editor while the script is running, the file modification time is not updated on the container file system until the script ends. What this means is that the ON_CHANGE action is not triggered when `vi` writes the file.
122
+
If the Appsody stack of interest uses a script file (.sh for example) that is then edited by the `vi` editor while the script is running, the file modification time is not updated on the container file system until the script ends. What this means is that the ON_CHANGE action is not triggered when `vi` writes the file.
117
123
118
124
## Contributing
119
125
@@ -123,6 +129,6 @@ We welcome all contributions to the Appsody project. Please see our [Contributin
123
129
124
130
Join our [Slack](https://appsody-slack.eu-gb.mybluemix.net/) to meet the team, ask for help, and talk about Appsody!
125
131
126
-
## Licence
132
+
## License
127
133
128
-
Please see [LICENSE](https://github.com/appsody/docs/blob/master/LICENSE) and [NOTICES](https://github.com/appsody/website/blob/master/NOTICE.md) for more information.
134
+
Please see [LICENSE](https://github.com/appsody/website/blob/master/LICENSE) and [NOTICES](https://github.com/appsody/website/blob/master/NOTICE.md) for more information.
0 commit comments