Skip to content

Commit

Permalink
Docker part 1: run automated tests in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebazzz committed Mar 27, 2020
1 parent 4fa4b4b commit 9cab019
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 4 deletions.
13 changes: 11 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,23 @@ jobs:
- run:
name: Install Yarn
command: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.16.0
echo 'export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"' >> $BASH_ENV
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt update
apt install --no-install-recommends yarn
- run:
name: Fix TERM var for CIRCLECI builds
command: |
echo 'export TERM=dumb' >> $BASH_ENV
- run:
name: Workaround libgit2sharp library load error
command: |
dotnet tool install -g GitVersion.Tool --version 5.2.4
echo 'export LD_LIBRARY_PATH=/root/.dotnet/tools/.store/gitversion.tool/5.2.4/gitversion.tool/5.2.4/tools/netcoreapp3.1/any/runtimes/debian.9-x64/native/' >> $BASH_ENV
echo 'export PATH="/root/.dotnet/tools:$PATH"' >> $BASH_ENV
- run:
name: Output important software versions
command: |
Expand Down
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build.sh text eol=lf
*.sh text eol=lf
Dockerfile text eol=lf
build.cake text eol=lf
2 changes: 2 additions & 0 deletions PokerTime.sln
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PokerTime.Web.Tests.Unit",
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{D6A25E46-E0CC-408F-B824-AA704427EBAB}"
ProjectSection(SolutionItems) = preProject
.dockerignore = .dockerignore
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
.prettierrc = .prettierrc
Dockerfile = Dockerfile
README.md = README.md
EndProjectSection
EndProject
Expand Down
2 changes: 1 addition & 1 deletion build.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
CAKE_VERSION=0.37.0
DOTNET_VERSION=3.1.103
DOTNET_VERSION=3.1.201
12 changes: 12 additions & 0 deletions utils/install-app-prereqs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function ensure_success {
exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "... command exited with code $exit_status"
exit $exit_status
fi
}

echo "Installing app prerequisites..."
apt-get -qqy update
apt-get -qqy install libgdiplus
ensure_success
27 changes: 27 additions & 0 deletions utils/install-chromium.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
function ensure_success {
exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "... command exited with code $exit_status"
exit $exit_status
fi
}

echo "Installing Chromium prerequisites..."
apt-get -qqy update
apt-get -qqy install lsb-release libappindicator3-1
ensure_success

echo "Downloading Chromium debian package..."
curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
ensure_success

echo "Installing Chromium debian package..."
apt -y install ./google-chrome.deb
ensure_success

echo "Patching for running Chromium without sandbox"
sed -i 's|HERE/chrome"|HERE/chrome" --no-sandbox|g' /opt/google/chrome/google-chrome
ensure_success

echo "Clean-up"
rm google-chrome.deb
18 changes: 18 additions & 0 deletions utils/install-nodejs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function ensure_success {
exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "... command exited with code $exit_status"
exit $exit_status
fi
}

echo "Install node.js prerequisites"
apt-get -qq update && apt-get -qqy --no-install-recommends install wget gnupg git unzip
ensure_success

echo "Install node.js itself"
curl -sL https://deb.nodesource.com/setup_10.x | bash -
ensure_success

apt-get install --no-install-recommends -y gcc g++ make build-essential nodejs
ensure_success
16 changes: 16 additions & 0 deletions utils/install-yarn.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function ensure_success {
exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "... command exited with code $exit_status"
exit $exit_status
fi
}

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
ensure_success

echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
ensure_success

apt update && apt install --no-install-recommends yarn
ensure_success

0 comments on commit 9cab019

Please sign in to comment.