File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,13 +10,4 @@ before_install:
1010 - export PATH=$PATH:$HOME/.local/bin
1111
1212script :
13- # - if [ "$TRAVIS_TAG" != "" ]; then
14- # docker run -it --rm -v $TRAVIS_BUILD_DIR:/sources microsoft/dotnet:1.1.0-sdk-msbuild bash /sources/scripts/PublishDebug.sh;
15- # docker login -u "$DOCKER_USER" -p "$DOCKER_PASS";
16- # export REPO=reloni/todo-serivce;
17- # export TAG=Debug-"$TRAVIS_TAG";
18- # docker build -f Dockerfile.debug -t $REPO:$TAG .;
19- # docker tag $REPO:$TAG $REPO:latest;
20- # docker push $REPO;
21- # fi
22- ./Scripts/BuildImage.sh
13+ ./Scripts/BuildImage_Release.sh
Original file line number Diff line number Diff line change 1+ FROM microsoft/dotnet:1.1.2-runtime
2+
3+ # Install the AWS CLI
4+ RUN apt-get update && \
5+ apt-get -y install python curl unzip && cd /tmp && \
6+ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" \
7+ -o "awscli-bundle.zip" && \
8+ unzip awscli-bundle.zip && \
9+ ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws && \
10+ rm awscli-bundle.zip && rm -rf awscli-bundle
11+
12+ # Copy our code to the "/app" folder in our container
13+ WORKDIR /app
14+ COPY ./published/release .
15+
16+ # Expose port 5000 for the Web API traffic
17+ ENV ASPNETCORE_URLS http://+:5000
18+ EXPOSE 5000
19+
20+ ENV ASPNETCORE_ENVIRONMENT Production
21+ ENV CONNECTIONSTRINGNAME ConnectionString_Postgres
22+
23+ COPY ./Scripts/secrets-entrypoint.sh /secrets-entrypoint.sh
24+ ENTRYPOINT ["/secrets-entrypoint.sh"]
25+
26+ # Run the dotnet application against a DLL from within the container
27+ #ENTRYPOINT ["dotnet", "SimpleToDoService.dll"]
28+ CMD [dotnet, "SimpleToDoService.dll"]
Original file line number Diff line number Diff line change 33
44if [ " ${TRAVIS_TAG} " != " " ]; then
55
6- docker run -it -d --name builder microsoft/dotnet:1.1.0 -sdk-msbuild tail -f /dev/null
6+ docker run -it -d --name builder microsoft/dotnet:1.1.2 -sdk tail -f /dev/null
77 docker cp src/SimpleToDoService builder:app
8- docker exec builder bash -c ' cd /app; dotnet restore; dotnet publish -o "../published/debug "'
8+ docker exec builder bash -c ' cd /app; dotnet restore; dotnet publish --configuration release - o "../published/release "'
99 docker cp builder:published published
1010
1111 # push to AWS
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ set -e
3+
4+ if [ " ${TRAVIS_TAG} " != " " ]; then
5+
6+ docker run -it -d --name builder microsoft/dotnet:1.1.2-sdk tail -f /dev/null
7+ docker cp src/SimpleToDoService builder:app
8+ docker exec builder bash -c ' cd /app; dotnet restore; dotnet publish --configuration release -o "../published/release"'
9+ docker cp builder:published published
10+
11+ # push to AWS
12+ aws ecr get-login --region eu-central-1 > login
13+ eval " $( cat login) "
14+ export REPO=${DOCKER_AWS_REPONAME}
15+ export TAG=${TRAVIS_TAG} -release
16+ docker build -f Dockerfile.release -t $REPO :$TAG .
17+ docker tag $REPO :$TAG $REPO :latest
18+ docker push $REPO > PushLog.log
19+ echo " AWS push log ===="
20+ cat PushLog.log
21+ echo " ======"
22+
23+ # push to docker-hub
24+ docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
25+ export REPO=reloni/todo-service
26+ docker build -f Dockerfile.release -t $REPO :$TAG .
27+ docker tag $REPO :$TAG $REPO :latest
28+ docker push $REPO > PushLog.log
29+ echo " Docker hub push log ===="
30+ cat PushLog.log
31+ echo " ======"
32+ fi
33+
34+ exit 0;
You can’t perform that action at this time.
0 commit comments