Skip to content

Commit 2abc4c7

Browse files
committed
Modify build script
1 parent ad4c421 commit 2abc4c7

3 files changed

Lines changed: 24 additions & 39 deletions

File tree

Dockerfile.debug

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM microsoft/dotnet:1.1.0-runtime
1+
FROM microsoft/dotnet:1.1.2-runtime
22

33
# Install the AWS CLI
44
RUN apt-get update && \
@@ -24,4 +24,10 @@ ENV CONNECTIONSTRINGNAME ConnectionString_Postgres
2424
COPY ./Scripts/secrets-entrypoint.sh /secrets-entrypoint.sh
2525
COPY ./Scripts/RestoreDB.sh /RestoreDB.sh
2626
COPY ./Scripts/CreateDB.sql /CreateDB.sql
27+
COPY ./Scripts/MigrateDB.sh /MigrateDB.sh
28+
RUN chmod +x /MigrateDB.sh
29+
30+
RUN mkdir Migrations
31+
COPY ./Scripts/Migrations/1.sql /Migrations/1.sql
32+
2733
ENTRYPOINT ["/secrets-entrypoint.sh"]

Scripts/BuildImage_Debug.sh

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,27 @@ if [ "${TRAVIS_TAG}" != "" ]; then
1515

1616
docker run -it -d --name builder microsoft/dotnet:1.1.2-sdk tail -f /dev/null
1717
docker cp src/SimpleToDoService builder:app
18-
docker exec builder bash -c 'cd /app; dotnet restore; dotnet publish --configuration release -o "../published/release"'
18+
if [ "$SUBTAG" = "release" ]; then
19+
docker exec builder bash -c 'cd /app; dotnet restore; dotnet publish --configuration release -o "../published/release"'
20+
else
21+
docker exec builder bash -c 'cd /app; dotnet restore; dotnet publish --configuration debug -o "../published/debug"'
22+
fi
1923
docker cp builder:published published
2024

25+
if [ "$SUBTAG" = "release" ]; then
26+
export DOCKERFILE=Dockerfile.release
27+
else
28+
export DOCKERFILE=Dockerfile.debug
29+
fi
30+
2131
#push to AWS
2232
aws ecr get-login --no-include-email --region ${DOCKER_AWS_REGION} > login
2333
eval "$(cat login)"
24-
docker build -f Dockerfile.release -t $REPO:$TAG .
34+
docker build -f $DOCKERFILE -t $REPO:$TAG .
2535
if [ "$SUBTAG" = "release" ]; then
2636
docker tag $REPO:$TAG $REPO:latest
37+
else
38+
docker tag $REPO:$TAG $REPO:dev-latest
2739
fi
2840
docker push $REPO > PushLog.log
2941
echo "AWS push log ===="
@@ -33,9 +45,11 @@ if [ "${TRAVIS_TAG}" != "" ]; then
3345
#push to docker-hub
3446
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
3547
export REPO=reloni/todo-service
36-
docker build -f Dockerfile.release -t $REPO:$TAG .
48+
docker build -f $DOCKERFILE -t $REPO:$TAG .
3749
if [ "$SUBTAG" = "release" ]; then
3850
docker tag $REPO:$TAG $REPO:latest
51+
else
52+
docker tag $REPO:$TAG $REPO:dev-latest
3953
fi
4054
docker push $REPO > PushLog.log
4155
echo "Docker hub push log ===="

0 commit comments

Comments
 (0)