diff --git a/.dockerignore b/.dockerignore index 8ee1bf9..95315a7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ .stack-work +.travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6d94b8a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,24 @@ +sudo: required + +services: + - docker + +addons: + apt: + packages: + - docker-ce + +before_install: + - docker build -t erebe/wstunnel . + +script: + - docker run --rm -ti -v $(pwd):/mnt erebe/wstunnel /bin/sh -c 'cp wstunnel /mnt' + +deploy: + provider: releases + skip_cleanup: true + api_key: + secure: AbS+BiwuYyXvcdpcHfdqQbug3I/PrFM4hl90RA1nnjLWWFnI03c0Em8EyTlFHp4FvJSDHmBXu2u6TD5QUVgo4YqKaOf6VqJCdbxvH0zubYBGhURtvCT9OGrl9emoUvpzsxLvFXminuVGGcfcn6Vk80wAszQhrDUNmzSDq8RwKLyjMx2xs/hmilz3+4oZ9HbFodho9v14VrboERgImxHBslR1/RrTCNKQAtOZzPhpxlWPEuQuD2Mx/8l+4TV8kBf61vKUncMrV/h6v8pR7aY78JuUXJszwKJwoeBwiBc22UaWzAP3ZSQEIKEJVpEH3q/JtYJcxutf8JnOdDCng/xN7n18GSN7YDrQe/AWVm0iS+keNx76zZrBKTW6sxUQRHhQq16wS3v5ve5yScL60TXKGcRGlmGbFwjGukFqj4MM/iK7JzfAqSyEwuh2S4IaBnaJj0AJW+608QMsO06AnCHIfi0lOtOLltEzBCAxj5ER+pTNrIq1jFE38hen0sTQknB16NmSKsleisbrZm2Vs32csGHt50TdG6keLmy94cTbXcvYsU2/LF6PApyYfL1rNFmSeUzVaqHamwemUOJXtUewveOcwkKz/bUA65movEeA3kJSv46r+sQ/3HQQLlLGw6wK2Yzc9sNf90OPBqBJ6ZJoAtBN2U1zIHoI4XW+RsKdURE= + file: wstunnel + on: + tags: true diff --git a/Dockerfile b/Dockerfile index 7fbb072..6f0c894 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,8 @@ RUN rm -rf ~/.stack && \ COPY . /mnt -RUN stack install --split-objs --ghc-options="-fPIC -fllvm" +RUN echo ' ld-options: -static -Wl,--unresolved-symbols=ignore-all' >> wstunnel.cabal ; \ + stack install --split-objs --ghc-options="-fPIC -fllvm" RUN upx --ultra-brute /root/.local/bin/wstunnel @@ -27,5 +28,5 @@ WORKDIR /root COPY --from=builder /root/.local/bin/wstunnel . RUN chmod +x ./wstunnel -ENTRYPOINT ["./wstunnel"] +CMD ["./wstunnel"] diff --git a/wstunnel.cabal b/wstunnel.cabal index dc123a6..b101eb5 100644 --- a/wstunnel.cabal +++ b/wstunnel.cabal @@ -35,24 +35,6 @@ library default-language: Haskell2010 -executable wstunnel - hs-source-dirs: app - main-is: Main.hs - default-extensions: NoImplicitPrelude, ScopedTypeVariables, BangPatterns, RecordWildCards - ghc-options: -threaded - -O3 - -rtsopts "-with-rtsopts=-N" --- ld-options: -static - build-depends: base - , bytestring - , classy-prelude - , cmdargs - , hslogger - , text >= 1.2.2.1 - , wstunnel - - default-language: Haskell2010 - test-suite wstunnel-test type: exitcode-stdio-1.0 hs-source-dirs: test @@ -66,3 +48,20 @@ test-suite wstunnel-test source-repository head type: git location: https://github.com/githubuser/wstunnel + +executable wstunnel + hs-source-dirs: app + main-is: Main.hs + default-extensions: NoImplicitPrelude, ScopedTypeVariables, BangPatterns, RecordWildCards + ghc-options: -threaded + -O3 + -rtsopts "-with-rtsopts=-N" + build-depends: base + , bytestring + , classy-prelude + , cmdargs + , hslogger + , text >= 1.2.2.1 + , wstunnel + + default-language: Haskell2010