forked from CS3219-AY2324S1/ay2324s1-course-assessment-g07
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker_build.sh
31 lines (23 loc) · 958 Bytes
/
docker_build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# Microservices directory
microservices=("chat-service" "collaboration-service" "editor-service" "eval-service" "frontend" "history-service" "matchmaking-service" "question-service" "user-service")
microservices_allowedOrigins=("editor-service" "history-service" "question-service" "user-service")
# Docker repository
repository="imrajsingh"
# Loop through each microservice
# for microservice in "${microservices_allowedOrigins[@]}"
for microservice in "${microservices[@]}"
do
# Go into the microservice directory
cd $microservice
# Build the Docker image
docker build -t $microservice-image --no-cache .
# Tag the Docker image
docker tag $microservice-image $repository/$microservice-image
# Push the Docker image to the repository
docker push $repository/$microservice-image
# Go back to the parent directory
cd ..
echo "${microservice} built successfully"
echo ""
done