From ceb274478d213d6167bcc6bb023892324d04d5d3 Mon Sep 17 00:00:00 2001 From: Malte Langkabel Date: Tue, 17 Dec 2019 11:04:02 +0100 Subject: [PATCH] build: added Travis ci for Linux builds (#857) --- .gitlab-ci.yml | 113 ------------------ .travis.yml | 12 ++ README.md | 4 +- .../dockerfiles/linux/travis_ci/Dockerfile | 5 + .../dockerfiles/linux/travis_ci/entrypoint.sh | 15 +++ 5 files changed, 35 insertions(+), 114 deletions(-) delete mode 100644 .gitlab-ci.yml create mode 100644 .travis.yml create mode 100644 deployment/dockerfiles/linux/travis_ci/Dockerfile create mode 100644 deployment/dockerfiles/linux/travis_ci/entrypoint.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 809c325a..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,113 +0,0 @@ -variables: - MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository" - IMAGE_64: coatisoftware/centos7_64_qt_llvm:qt5126-llvm900 - IMAGE_32: coatisoftware/centos6_32_qt_llvm:qt5101-llvm800 - -## Templates ## - -.build_template: &build_def - stage: build - before_script: - # CCache Config/jobs - - mkdir -p ccache - - export CCACHE_BASEDIR=${PWD} - - export CCACHE_DIR=${PWD}/ccache - script: - - ./script/buildonly.sh all - - ./script/buildonly.sh package - # - ./script/build.sh release test - artifacts: - name: "$CI_JOB_NAME" - paths: - - Sourcetrail*.tar.gz - expire_in: 3 days - -.deploy_template: &deploy_def - image: alpine - stage: deploy - before_script: - - apk add --no-cache lftp git - script: - - VERS=$(git describe --long | sed 's/-/./' | sed 's/-.*//') - - TARGET_DIR=releases-$CI_ENVIRONMENT_NAME/$TYPE/$VERS - - echo $TARGET_DIR/$CI_ENVIRONMENT_NAME/$TYPE/ - - lftp -u $FTP_USER,$FTP_PW -p $FTP_PORT $FTP_ADDR -e "mkdir $TARGET_DIR; mput -O $TARGET_DIR Sourcetrail*; bye" - only: - - master - - tags - - /^release.*$/ - - -## Build Stage ## - -build:Linux64: - image: $IMAGE_64 - when: manual - cache: - key: cache_linux_64 - paths: - - ccache/ - - java_indexer/.m2/repository - <<: *build_def - -build:Linux32: - image: $IMAGE_32 - when: manual - cache: - key: cache_linux_32 - paths: - - ccache/ - - java_indexer/.m2/repository - <<: *build_def - -## Deploy ## - -deploy:Linux_staging_beta: - when: manual - environment: - name: staging - variables: - TYPE: beta - <<: *deploy_def - -deploy:Linux_staging_full: - when: manual - environment: - name: staging - variables: - TYPE: full - <<: *deploy_def - -deploy:Linux_production_beta: - when: manual - environment: - name: production - variables: - TYPE: beta - <<: *deploy_def - -deploy:Linux_production_full: - when: manual - environment: - name: production - variables: - TYPE: full - <<: *deploy_def - -deploy:Linux_tag_staging: - environment: - name: staging - variables: - TYPE: beta - <<: *deploy_def - only: - - tags - -## could be interesting for daily/weekly/monthly builds -# https://docs.gitlab.com/ce/user/project/pipelines/schedules.html -# -#job:on-schedule: -#only: -# - schedules -# - diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..9297c580 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: bash + +services: docker + +install: + - chmod 777 deployment/dockerfiles/linux/travis_ci/entrypoint.sh + - docker build -t coatisoftware/local deployment/dockerfiles/linux/travis_ci + +script: + - COMMIT_HASH=$(git rev-parse HEAD) + - docker run --name builder coatisoftware/local ${COMMIT_HASH} + diff --git a/README.md b/README.md index 912a233d..1c986825 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ [Sourcetrail](https://www.sourcetrail.com/) is a free and open-source cross-platform source explorer that helps you get productive on unfamiliar source code. -[![Build status](https://ci.appveyor.com/api/projects/status/0c258a2opn3loyc2/branch/master?svg=true)](https://ci.appveyor.com/project/mlangkabel/sourcetrail/branch/master) +Windows: [![Build status](https://ci.appveyor.com/api/projects/status/0c258a2opn3loyc2/branch/master?svg=true)](https://ci.appveyor.com/project/mlangkabel/sourcetrail/branch/master) + +Linux: [![Build Status](https://travis-ci.org/CoatiSoftware/Sourcetrail.svg?branch=master)](https://travis-ci.org/CoatiSoftware/Sourcetrail) __Links__ diff --git a/deployment/dockerfiles/linux/travis_ci/Dockerfile b/deployment/dockerfiles/linux/travis_ci/Dockerfile new file mode 100644 index 00000000..3d7b4107 --- /dev/null +++ b/deployment/dockerfiles/linux/travis_ci/Dockerfile @@ -0,0 +1,5 @@ +FROM coatisoftware/centos7_64_qt_llvm:qt5126-llvm900 + +COPY entrypoint.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/deployment/dockerfiles/linux/travis_ci/entrypoint.sh b/deployment/dockerfiles/linux/travis_ci/entrypoint.sh new file mode 100644 index 00000000..df4c1cb6 --- /dev/null +++ b/deployment/dockerfiles/linux/travis_ci/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/sh -l + +echo "building commit: $1" + +git clone https://github.com/CoatiSoftware/Sourcetrail.git + +cd Sourcetrail + +git checkout $1 + +./script/buildonly.sh all + +./script/buildonly.sh package + +./script/build.sh release test