From 1f5f079c1504f95c5aecc0217b525721b061e5bc Mon Sep 17 00:00:00 2001 From: Alax Alves Date: Tue, 18 Sep 2018 17:48:45 -0300 Subject: [PATCH 1/2] Creating Dockerfile for required architectures --- Dockerfile-amd64 | 11 +++++++++++ Dockerfile-i386 | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 Dockerfile-amd64 create mode 100644 Dockerfile-i386 diff --git a/Dockerfile-amd64 b/Dockerfile-amd64 new file mode 100644 index 00000000..1c33de09 --- /dev/null +++ b/Dockerfile-amd64 @@ -0,0 +1,11 @@ +// Using AMD64 Architecture +FROM debian:jessie + +RUN apt-get update && \ + apt-get install -y flex bison cmake build-essential python debhelper devscripts + +ADD . /doxyparse + +WORKDIR /doxyparse + +CMD ["sh", "deploy.sh"] diff --git a/Dockerfile-i386 b/Dockerfile-i386 new file mode 100644 index 00000000..30d4591b --- /dev/null +++ b/Dockerfile-i386 @@ -0,0 +1,12 @@ +// Using i386 Architecture +FROM i386/debian:jessie + +RUN apt-get update && \ + apt-get install -y flex bison cmake build-essential python debhelper devscripts + +ADD . /doxyparse + +WORKDIR /doxyparse + +ENTRYPOINT ["linux32"] +CMD ["sh", "deploy.sh"] From 3ac74b69c4890d8b631c1c6f1b0efa63bab2e75a Mon Sep 17 00:00:00 2001 From: Alax Alves Date: Tue, 18 Sep 2018 17:49:43 -0300 Subject: [PATCH 2/2] Enabling automated deploy through travis --- .travis.yml | 6 ++++++ Dockerfile-amd64 | 15 +++++++++++---- Dockerfile-i386 | 15 +++++++++++---- compile-pkg.sh | 10 ++++++++++ docker-deploy.sh | 23 +++++++++++++++++++++++ 5 files changed, 61 insertions(+), 8 deletions(-) create mode 100755 compile-pkg.sh create mode 100644 docker-deploy.sh diff --git a/.travis.yml b/.travis.yml index acc325a2..9a69619c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,3 +21,9 @@ script: - make - make tests - make docs + +deploy: + provider: script + script: sh docker-deploy.sh + on: + branch: master diff --git a/Dockerfile-amd64 b/Dockerfile-amd64 index 1c33de09..e71534bd 100644 --- a/Dockerfile-amd64 +++ b/Dockerfile-amd64 @@ -1,11 +1,18 @@ -// Using AMD64 Architecture +# Using AMD64 Architecture FROM debian:jessie -RUN apt-get update && \ - apt-get install -y flex bison cmake build-essential python debhelper devscripts +RUN apt-get update -qq && \ + apt-get install -y flex \ + bison \ + git \ + cmake \ + build-essential \ + python \ + debhelper \ + devscripts ADD . /doxyparse WORKDIR /doxyparse -CMD ["sh", "deploy.sh"] +CMD ["sh", "compile-pkg.sh"] diff --git a/Dockerfile-i386 b/Dockerfile-i386 index 30d4591b..b775bb32 100644 --- a/Dockerfile-i386 +++ b/Dockerfile-i386 @@ -1,12 +1,19 @@ -// Using i386 Architecture +# Using i386 Architecture FROM i386/debian:jessie -RUN apt-get update && \ - apt-get install -y flex bison cmake build-essential python debhelper devscripts +RUN apt-get update -qq && \ + apt-get install -y flex \ + bison \ + git \ + cmake \ + build-essential \ + python \ + debhelper \ + devscripts ADD . /doxyparse WORKDIR /doxyparse ENTRYPOINT ["linux32"] -CMD ["sh", "deploy.sh"] +CMD ["sh", "compile-pkg.sh"] diff --git a/compile-pkg.sh b/compile-pkg.sh new file mode 100755 index 00000000..0d0ff68c --- /dev/null +++ b/compile-pkg.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Compiling repository +mkdir build/ +cd build/ +cmake -G "Unix Makefiles" -Dbuild_parse=ON +make + +cd .. +rm -rf build/ diff --git a/docker-deploy.sh b/docker-deploy.sh new file mode 100644 index 00000000..40a0256b --- /dev/null +++ b/docker-deploy.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# Represents the latest version of the project according to VERSION file +VERSION=$(cat VERSION) + +DOCKERFILE_AMD64=$PWD/Dockerfile-amd64 +DOCKERFILE_I386=$PWD/Dockerfile-i386 + +echo "Latest Doxyparse version is $VERSION"; + +# double validation in script and in .travis.yml +if [[ "${TRAVIS_BRANCH}" == "master" ]]; then + echo "Deploying to Docker registry latest Doxyparse..."; + docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"; + docker build -f $DOCKERFILE_AMD64 -t doxyparse:amd64-$VERSION .; + docker build -f $DOCKERFILE_I386 -t doxyparse:i386-$VERSION .; + docker tag doxyparse:amd64-$VERSION $DOCKER_USERNAME/doxyparse:amd64-$VERSION; + docker tag doxyparse:i386-$VERSION $DOCKER_USERNAME/doxyparse:i386-$VERSION; + docker push $DOCKER_USERNAME/doxyparse:amd64-$VERSION; + docker push $DOCKER_USERNAME/doxyparse:i386-$VERSION; +else + echo "Skipping Docker registry deploy"; +fi;