Skip to content

Commit aafb9a1

Browse files
authored
Merge pull request #763 from MetaCell/feature/CH-142
CH-142 Add dockerfile build args support to apps
2 parents 25098cc + 37d0ec8 commit aafb9a1

15 files changed

Lines changed: 439 additions & 216 deletions

File tree

applications/samples/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ ARG CLOUDHARNESS_FLASK
33

44
FROM $CLOUDHARNESS_FRONTEND_BUILD as frontend
55

6+
ARG TEST_ARGUMENT=default
7+
RUN echo $TEST_ARGUMENT
8+
69
ENV APP_DIR=/app
710

811
WORKDIR ${APP_DIR}

applications/samples/deploy/values-minimal.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ harness:
44
soft: []
55
hard: []
66
use_services: []
7-
7+
dockerfile:
8+
buildArgs:
9+
TEST_ARGUMENT: 'minimal value'

applications/samples/deploy/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,7 @@ harness:
8484
- "--request-timeout=180000"
8585
- "--hypothesis-max-examples=2"
8686
- "--show-errors-tracebacks"
87+
88+
dockerfile:
89+
buildArgs:
90+
TEST_ARGUMENT: example value

docs/applications/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ The most important configuration entries are the following:
117117
- `use_services` (`{name, src, dst}[]`): create reverse proxy endpoints in the ingress for the listed applications on [subdomain].[Values.domain]/proxy/[name]. Useful to avoid CORS requests from frontend clients
118118
- `readinessProbe`: defines a a url to use as a readiness probe
119119
- `livenessProbe`: defines a a url to use as a liveness probe
120+
- `dockerfile`: configuration for the dockerfile, currently only implemented in Skaffold
121+
- `buildArgs`: a map of build arguments to provide to the dockerfile when building with Skaffold
120122

121123
# Example code
122124
- [Sample application](../../applications/samples) is a sample web application providing working examples of deployment configuration, backend and frontend code.

docs/build-deploy/ci-cd/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ All you need to to is:
1515
- Run `skaffold build`
1616
- Run `skaffold run`
1717

18+
### Dockerfile configuration with Skaffold
19+
20+
When defining an applications values you can provide details on dockerfile configuration such as build arguments. This feature is intended to support useful development use cases (e.g. conditionally running unit tests via build arguments) and should be used with caution as it can lead to different images in different deployment environments.
21+
1822
## CI/CD with Codefresh
1923

2024
[Codefresh](https://codefresh.io/) is a nice platform for CI/CD see details in the [dedicated document](./codefresh.md).

docs/model/ApplicationHarnessConfig.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ Name | Type | Description | Notes
2727
**accounts** | [**ApplicationAccountsConfig**](ApplicationAccountsConfig.md) | | [optional]
2828
**test** | [**ApplicationTestConfig**](ApplicationTestConfig.md) | | [optional]
2929
**quotas** | **Dict[str, object]** | | [optional]
30+
**env** | [**List[NameValue]**](NameValue.md) | Environmental variables added to all containers (deprecated, please use envmap) | [optional]
31+
**envmap** | **Dict[str, object]** | | [optional]
32+
**dockerfile** | [**DockerfileConfig**](DockerfileConfig.md) | | [optional]
3033

3134
## Example
3235

docs/model/DockerfileConfig.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# DockerfileConfig
2+
3+
Configuration for a dockerfile
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**build_args** | **Dict[str, object]** | | [optional]
10+
11+
## Example
12+
13+
```python
14+
from cloudharness_model.models.dockerfile_config import DockerfileConfig
15+
16+
# TODO update the JSON string below
17+
json = "{}"
18+
# create an instance of DockerfileConfig from a JSON string
19+
dockerfile_config_instance = DockerfileConfig.from_json(json)
20+
# print the JSON string representation of the object
21+
print DockerfileConfig.to_json()
22+
23+
# convert the object into a dict
24+
dockerfile_config_dict = dockerfile_config_instance.to_dict()
25+
# create an instance of DockerfileConfig from a dict
26+
dockerfile_config_form_dict = dockerfile_config.from_dict(dockerfile_config_dict)
27+
```
28+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
29+
30+

docs/model/HarnessMainConfig.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ Name | Type | Description | Notes
1414
**registry** | [**RegistryConfig**](RegistryConfig.md) | | [optional]
1515
**tag** | **str** | Docker tag used to push/pull the built images. | [optional]
1616
**apps** | [**Dict[str, ApplicationConfig]**](ApplicationConfig.md) | |
17-
**env** | [**List[NameValue]**](NameValue.md) | Environmental variables added to all pods (deprecated, please use envmap) | [optional]
17+
**env** | [**List[NameValue]**](NameValue.md) | Environmental variables added to all pods | [optional]
1818
**privenv** | [**NameValue**](NameValue.md) | | [optional]
1919
**backup** | [**BackupConfig**](BackupConfig.md) | | [optional]
2020
**name** | **str** | Base name | [optional]
2121
**task_images** | **Dict[str, object]** | | [optional]
2222
**build_hash** | **str** | | [optional]
23-
**envmap** | **Dict[str, object]** | | [optional]
2423

2524
## Example
2625

0 commit comments

Comments
 (0)