Files
Sourcetrail/.gitlab-ci.yml
T

136 lines
2.9 KiB
YAML

variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
IMAGE_64: coatisoftware/centos6_64_qt_llvm:qt591-llvm500
IMAGE_32: coatisoftware/centos6_32_qt_llvm:qt591-llvm500
## 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
- ./build/Release/app/Sourcetrail config -z ./setup/license.txt
- ./script/build.sh r 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
only:
- /^release.*$/
- master
- tags
cache:
key: cache_linux_64
paths:
- ccache/
- java_indexer/.m2/repository
<<: *build_def
build:Linux32:
image: $IMAGE_32
only:
- /^release.*$/
- master
- tags
cache:
key: cache_linux_32
paths:
- ccache/
- java_indexer/.m2/repository
when: manual
<<: *build_def
LicenseGenerator:
image: $IMAGE_64
stage: build
when: manual
script:
- ./script/setup.sh
- ./script/buildonly.sh r keygen
- mv build/Release/license_generator/Sourcetrail_license_generator .
artifacts:
name: "$CI_JOB_NAME"
paths:
- Sourcetrail_license_generator
expire_in: 3 days
## 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
#