Skip to content
This repository was archived by the owner on Feb 24, 2021. It is now read-only.

Commit 81512dc

Browse files
refactor: Create new compose-builder for generating compose files (#336)
* refactor: Create new compose-builder for generating compose files Moved all new files from release/nightly-build/compose-files/source to top level compose-builder folder. Refactored makefiles to account for new file locations Updated READMEs to account for these changes closes #335 * refactor: Remove build from makefile in nightly-build/compose-files * refactor: Change to use `make -C` on portainer targets.
1 parent b2b6742 commit 81512dc

28 files changed

+89
-58
lines changed
File renamed without changes.

releases/nightly-build/compose-files/source/Makefile renamed to compose-builder/Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,19 @@ ifeq (true, $(DS_GROVE))
8686
endif
8787
endif
8888

89+
COMPOSE_FOLDER:=../releases/nightly-build/compose-files
90+
ifneq (nexus, $(RELEASE))
91+
COMPOSE_FOLDER:=../releases/$(RELEASE)/compose-files
92+
endif
93+
8994
help:
9095
echo "See README.md in this folder"
9196

9297
portainer:
93-
cd ..; \
94-
make portainer
98+
make -C ../releases/nightly-build/compose-files portainer
9599

96100
portainer-down:
97-
cd ..; \
98-
make portainer-down
101+
make -C ../releases/nightly-build/compose-files portainer-down
99102

100103
build:
101104
make compose ds-rest ds-virtual
@@ -106,7 +109,7 @@ build:
106109
make compose ui arm64
107110

108111
compose: gen
109-
cat gen-header docker-compose.yml > ../docker-compose-$(RELEASE)$(UI)$(NO_SECURITY)$(MQTT)$(ARCH)$(DEV).yml
112+
cat gen-header docker-compose.yml > $(COMPOSE_FOLDER)/docker-compose-$(RELEASE)$(UI)$(NO_SECURITY)$(MQTT)$(ARCH)$(DEV).yml
110113

111114
run: gen
112115
docker-compose -p edgex up -d $(SERVICES)

releases/nightly-build/compose-files/source/README.md renamed to compose-builder/README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11

22

3-
## Source for Edgex Docker Compose for `master` builds
3+
## Edgex Docker Compose Builder
44

5-
This folder contains the **source** compose and environment files for generating the single file docker composes files one level up.
6-
7-
> **Note**:
8-
> *The files here are targeted for EdgeX community developers. Those just needing to run Edgex should use the generated compose files and Makefile one level up. See the accompanying [README](../README.md) for details.*
5+
This folder contains the `Compose Builder` which is made up of **source** compose and environment files and **makefile** for building the single file docker composes files for the configured `release`. The default release is `nexus` and the files are placed in `release/nightly-build/compose-files`.
96

107
> **Note to Developers**:
11-
> *Once you have edited and tested your changes to these source files you **MUST** regenerate the composes using the `Makefile` one level up. See `build-all` in the accompanying [README](../README.md) for details.*
8+
> *Once you have edited and tested your changes to these source files you **MUST** regenerate the composes using the `make build` command.*
9+
10+
Do the following to build compose files for next release such as `hanoi`
11+
12+
1. Update the `RELEASE`, `REPOSITORY`, `CORE_EDGEX_REPOSITORY` and `versions` contained in the `.env` file.
13+
2. Create the release folder, i.e `release/hanoi/compose-files`
14+
3. Run `make build`
15+
4. **Undo changes made to `.env` file**. (committed values **must** remain as `nexus/nightly-build`)
16+
5. Commit changes and open PR
1217

1318
The approach used with these source compose files is the `Extending using multiple Compose files` described here: https://docs.docker.com/compose/extends/#multiple-compose-files
1419

@@ -51,7 +56,7 @@ This folder contains the following compose files:
5156
This folder contains the following environment files:
5257

5358
- **.env**
54-
This file contains the registry and image version variables referenced in compose files. Docker compose implicitly uses the ".env" file, if it exists, so you will not see it referenced in the compose files. It is referenced in the Makefile so that it can also use these settings.
59+
This file contains the `version`, `repositories` and image `version` variables referenced in compose files. Docker compose implicitly uses the `.env` file, if it exists, so you will not see it referenced in the compose files. It is referenced in the Makefile so that it can also use these settings.
5560
- **common.env**
5661
This file contains the common environment overrides used by all Edgex services.
5762
- **common-security.env**
@@ -72,7 +77,8 @@ portainer-down Stops Portainer independent of the EdgeX services
7277
```
7378
```
7479
build
75-
Generates the all standard Edgex compose file variations and stores them one directory level up. Each variation, except UI, includes Device REST & Device Virtual
80+
Generates the all standard Edgex compose file variations and stores them in the configured relese folder. Each variation, except UI, includes Device REST & Device Virtual. Compose files are named appropriatly for release and options used to generate them.
81+
7682
Current variations are:
7783
full secure
7884
full secure for arm64
@@ -84,7 +90,8 @@ Current variations are:
8490

8591
```
8692
compose [options]
87-
Generates the EdgeX compose file as specified by options and stores it one directory level up with appropriate name for the options used.
93+
Generates the EdgeX compose file as specified by options and stores them in the configured relese folder. Compose files are named appropriatly for release and options used to generate them.
94+
8895
Options:
8996
no-secty: Generates non-secure compose file, otherwise generates secure compose file
9097
arm64: Generates compose file using ARM64 images
@@ -125,7 +132,7 @@ Services:
125132
```
126133
```
127134
pull [options] [services]
128-
Pulls the EdgeX service images as specified :
135+
Pulls the EdgeX service images as specified by:
129136
Options:
130137
no-secty: Pulls images for Non-Secure Mode, otherwise pull images for Secure Mode
131138
arm64: Pulls ARM64 version of images

0 commit comments

Comments
 (0)