Skip to content

Commit 886132d

Browse files
committed
Allowing for building from the repo_ref directory
1 parent 8ec1019 commit 886132d

File tree

4 files changed

+36
-6
lines changed

4 files changed

+36
-6
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
1-
# Docker compose managaged test harness
1+
# Docker compose managed test harness
22

33
Example for a blog post about nginx docker compose
44

55
## Setup
66

7-
To run this you will execute:
7+
To run this you will execute one of the following commands depending on your build source:
8+
9+
### Local Build
10+
11+
To build from local directories, run:
12+
13+
```bash
14+
./build_local.sh
15+
```
16+
17+
### GitHub Build
18+
19+
To build from GitHub repositories, run:
820

921
```bash
10-
docker compose up --build
22+
./build_github.sh
1123
```
1224

1325
Once the container is up and running, you can hit `http://localhost:8089/` it `/` will route you to FE react project by default.

build_github.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
# Set environment variables for GitHub build
4+
export FRONTEND_BUILD_CONTEXT=https://${GH_TOKEN}@${FRONTEND_REPO_URL}#${FRONTEND_REF}
5+
export API_BUILD_CONTEXT=https://${GH_TOKEN}@${API_REPO_URL}#${API_REF}
6+
export BACKEND_BUILD_CONTEXT=https://${GH_TOKEN}@${BACKEND_REPO_URL}#${BACKEND_REF}
7+
8+
# Run Docker Compose
9+
docker-compose -f compose.yaml up --build

build_local.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
# Set environment variables for local build
4+
export FRONTEND_BUILD_CONTEXT=./repo_refs/react1-app
5+
export API_BUILD_CONTEXT=./repo_refs/rails-app
6+
export BACKEND_BUILD_CONTEXT=./repo_refs/react2-app
7+
8+
# Run Docker Compose
9+
docker-compose -f compose.yaml up --build

compose.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
frontend:
3-
build: https://${GH_TOKEN}@${FRONTEND_REPO_URL}#${FRONTEND_REF}
3+
build: ${FRONTEND_BUILD_CONTEXT}
44
ports:
55
- 3000
66
networks:
@@ -9,7 +9,7 @@ services:
99
- PUBLIC_URL=${FRONTEND_PUBLIC_URL}
1010
- WDS_SOCKET_PORT=${WDS_SOCKET_PORT}
1111
api:
12-
build: https://${GH_TOKEN}@${API_REPO_URL}#${API_REF}
12+
build: ${API_BUILD_CONTEXT}
1313
ports:
1414
- 3000
1515
networks:
@@ -46,7 +46,7 @@ services:
4646
timeout: 5s
4747
retries: 3
4848
backend:
49-
build: https://${GH_TOKEN}@${BACKEND_REPO_URL}#${BACKEND_REF}
49+
build: ${BACKEND_BUILD_CONTEXT}
5050
ports:
5151
- 3000
5252
environment:

0 commit comments

Comments
 (0)