Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/obj/
**/bin/
packages/
paket-files
.git
.paket/*.exe
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
language: csharp
# mono: none

matrix:
allow_failures:
Expand All @@ -12,6 +11,15 @@ matrix:
sudo: required
dotnet: 2.1.104

- os: linux
services:
- docker
before_script:
- ./docko build

script:
- ./docko run --rm cec bash -c "./run test"

# https://docs.travis-ci.com/user/reference/osx/#OS-X-Version
- os: osx # OSX 10.13
osx_image: xcode9.3
Expand All @@ -22,5 +30,5 @@ before_script:
- bash -c "./run init"

script:
- bash -c "./run test:restore"
- bash -c "./run restore"
- bash -c "./run test"
42 changes: 42 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# TODO: publish this dev image
FROM microsoft/dotnet:2.0.7-sdk-2.1.105 AS dev-env
WORKDIR /app

RUN echo \
&& apt update \
&& apt install -y apt-transport-https

# MONO

# https://unix.stackexchange.com/a/253476/45041
RUN echo \
&& export CODENAME="$(dpkg --status tzdata|grep Provides|cut -f2 -d'-')" \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& echo "deb https://download.mono-project.com/repo/ubuntu stable-$CODENAME main" | tee /etc/apt/sources.list.d/mono-official-stable.list \
&& apt update \
&& apt install -y mono-complete

# PAKET

ENV PAKET_VERSION 5.156.0
ENV PAKET "mono /app/.paket/paket.exe"

COPY . ./
RUN echo \
&& cd /app/.paket \
&& wget https://github.com/fsprojects/Paket/releases/download/$PAKET_VERSION/paket.bootstrapper.exe \
&& chmod +x ./paket.bootstrapper.exe \
&& mono ./paket.bootstrapper.exe \
&& chmod +x ./paket.exe \
&& ${PAKET} restore


FROM microsoft/dotnet:2.0.7-sdk-2.1.105 AS build-env
# TODO..


# Build runtime image
FROM microsoft/aspnetcore:2.0 AS release
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "aspnetapp.dll"]
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '3.4'
services:
cec:
build:
context: .
dockerfile: Dockerfile
target: dev-env
volumes:
- .:/app
40 changes: 40 additions & 0 deletions docko
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
# Thanks, mac OS -.-
PAKET="./.paket/paket.exe"
FAKE="packages/build/FAKE/tools/FAKE.exe"

EXAMPLES_PROJ="examples/Examples.fsproj"
TEST_PROJ="tests/Test.CryptoExchangeClient/Test.CryptoExchangeClient.fsproj"
SRC_PROJ="src/CryptoExchangeClient.fsproj"

COMPOSE="docker-compose -f docker-compose.yml --project-directory . -p crypto-exchange-client"

function __run {

# First arg
given_command=$1
# The rest of the args
arguments=${@:2}

# For Sub-command redirection
sub_command=$2
sub_arguments=${@:3}


# For debugging
# echo "cmd: $given_command"
# echo "args: $arguments"

case $given_command in
bash) ${COMPOSE} run --rm cec bash;;

*)
echo "forwarding to docker-compose"
${COMPOSE} $@
esac
}

# Also allow non-sourced running
if [ $1 ]; then
__run $*
fi
File renamed without changes.
28 changes: 14 additions & 14 deletions paket.dependencies
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
source https://www.nuget.org/api/v2
nuget Chessie 0.6.0
nuget Colorful.Console 1.2.6
nuget CryptoExchangeClient 0.4.0
nuget Chessie ~> 0.6
nuget Colorful.Console ~> 1.2
nuget CryptoExchangeClient ~> 0.3
nuget Expecto
nuget FSharp.Core 4.3.4
nuget FSharp.Data 3.0.0-beta3 beta
nuget FSharp.Json 0.3.3
nuget FSharp.Core ~> 4.3
nuget FSharp.Data ~> 3.0.0-beta3 beta
nuget FSharp.Json ~> 0.3
clitool Microsoft.DotNet.Watcher.Tools
nuget Microsoft.NET.Test.Sdk 15.3.0-preview-20170628-02 preview
nuget Paket 5.156.0
nuget Rationals 1.3.1
nuget RestSharp 106.3.0-alpha0018 alpha
nuget SocketLite.PCL 4.2.1
nuget WebsocketClientLite.PCL 4.2.5
nuget xunit 2.2.0
nuget xunit.runner.visualstudio 2.2.0
nuget Microsoft.NET.Test.Sdk ~> 15.3.0-preview-20170628-02 preview
nuget Paket ~> 5.156
nuget Rationals ~> 1.3
nuget RestSharp ~> 106.3.0-alpha0018 alpha
nuget SocketLite.PCL ~> 4.2
nuget WebsocketClientLite.PCL ~> 4.2
nuget xunit ~> 2.2
nuget xunit.runner.visualstudio ~> 2.2
nuget YoloDev.Expecto.TestSdk
55 changes: 30 additions & 25 deletions paket.lock

Large diffs are not rendered by default.

25 changes: 22 additions & 3 deletions run
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
#!/bin/bash
function __exe_shim {
. /etc/os-release
os_name="$ID"

# MacOS, non-ubuntu debian-based OSes
if [ "$(uname)" == "Darwin" ]; then echo "mono "; fi
if [ "$os_name" == "debian" ]; then echo "mono "; fi

PAKET="./.paket/paket.exe"
# Ubuntu / Windows
echo ""
}

PAKET="$(__exe_shim) ./.paket/paket.exe"
FAKE="packages/build/FAKE/tools/FAKE.exe"

EXAMPLES_PROJ="examples/Examples.fsproj"
Expand All @@ -25,7 +35,7 @@ function __run {
# echo "args: $arguments"

case $given_command in
p) ${PAKET} $arguments;;
p) echo ": $PAKET :" && ${PAKET} $arguments;;
dn) dotnet $arguments;;
paket) ${PAKET} $arguments;;
fake) ${FAKE} $arguments Fake.fsx;;
Expand All @@ -44,6 +54,11 @@ function __run {
dotnet build $arguments
;;

rebuild)
( ./run clean:all ) && \
( ./run build )
;;

clean:all)
echo "Cleaning..."
# Don't name any folders bin or obj
Expand All @@ -55,9 +70,13 @@ function __run {
cd .paket \
rm paket.exe paket.bootstrapper* \

local exeshim=__exe_shim

echo "shim: $exeshim"

wget https://github.com/fsprojects/Paket/releases/download/5.156.0/paket.bootstrapper.exe \
&& chmod +x paket.bootstrapper.exe \
&& ./paket.bootstrapper.exe \
&& ${exeshim} ./paket.bootstrapper.exe \
&& chmod +x paket.exe
;;

Expand Down
2 changes: 1 addition & 1 deletion src/CryptoExchangeClient.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageLicenseUrl>https://github.com/NullVoxPopuli/CryptoExchangeClient/blob/master/LICENSE</PackageLicenseUrl>
<Description>Clients for multiple cryptocurrency exchanges. All clients have a shared interface for common actions.
</Description>
<PackageTags>cryptocurrency, blockchain, rest, websocket, api, client, crypto, bitcoin, exchange</PackageTags>
<PackageTags>cryptocurrency, blockchain, rest, websocket, api, client, crypto, bitcoin, exchange, ethereum</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
Expand Down