- Notifications
You must be signed in to change notification settings - Fork 167
[WIP] Initial work on running tests against the images for PRs #195
Conversation
build.sh Outdated
| set -o pipefail # Carry failures over pipes | ||
| | ||
| repo_root="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
| docker_repo="microsoft/aspnetcore" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to also account for files that are on the microsoft/aspnetcore-build repo instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this doesn't actually push to dockerhub it doesn't matter. You just need some name to refer to the images that are built to test them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, could we use something different, like 'test/aspnetcore'?
build.sh Outdated
| done | ||
| } | ||
| | ||
| build_dockerfiles "$( find . -path './.*' -prune -o -name 'Dockerfile' -a -path '**/*' -print0 | xargs -0 -n1 dirname )" No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: consider adding trailing end-line to all files.
test/create-run-publish-app.sh Outdated
| dotnet restore | ||
| dotnet publish -o publish/self-contained | ||
| else | ||
| sed -i '/<PropertyGroup>/a \ <RuntimeIdentifiers>debian.8-x64<\/RuntimeIdentifiers>' ./${PWD##*/}.csproj |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to edit the file. This can be based on command line as dotnet restore /p:RuntimeIdentifiers=debian.8-x64. Or, we can just add it to the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RIght, i didn't realize this was an option with the new CLI. So if a csproj doesn't specify the RID as long as I have restored specifying the RID I can also publish for a specific RID and it will be standalone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
test/test.sh Outdated
| set -e # Exit immediately upon failure | ||
| set -o pipefail # Carry failures over pipes | ||
| | ||
| docker_repo="microsoft/aspnetcore" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
microsoft/aspnetcore-build
| @@ -0,0 +1,29 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@friism recently made a contribution to the dotnet-docker repo last week which changed this pattern to use a Dockerfile instead. This removed the host dependency which allows the tests to be run against a remote daemon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, my I have looked at his PR and intent to do the same here. But I already had enough of this done that it seemed worthwhile to do a PR and then change it instead of waiting. More coverage sooner seemed like a good idea.
| RUN chmod +x /packagescache/build-cache.sh \ | ||
| && /packagescache/build-cache.sh https://dist.asp.net/packagecache/1.1.0/aspnetcore.packagecache-1.1.0-legacy-debian.8-x64.tar.gz \ | ||
| RUN chmod +x /packagescache/build-cache.sh | ||
| RUN /packagescache/build-cache.sh https://dist.asp.net/packagecache/1.1.0/aspnetcore.packagecache-1.1.0-legacy-debian.8-x64.tar.gz \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change? (did you intend to check this in?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC this was changed because Glenn hit moby/moby#9547
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the issue Nate linked is the reason. Presumably we don't have to chmod inside the container at all, and I had intended to look at removing it completely if it was possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry
| Btw, travis is enabled now. Try pushing and empty commit to trigger a run. |
| Tentative |
| CI Passed 🎆 Squash and |
This mostly copies the current state of the dotnet-docker repo, and probably should evolve in the same way.