Commit 487562c9 authored by Matteo De Carlo's avatar Matteo De Carlo
Browse files

Add gitlab ci configuration for build and deploy

osx build is broken and deactivated
parent f18bea83
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -54,6 +54,9 @@ gmon.out
.cproject
.settings/

# Intellij files
.idea/

# Geany/geany-plugins files
*.geany
.geanyprj

.gitlab-ci.yml

0 → 100644
+84 −0
Original line number Diff line number Diff line
stages:
  - build
  - test
  - deploy

# prototype build job
.build:
  tags:
    - linux
    - threadripper
  stage: build
  image: ubuntu:bionic
  variables:
    PLATFORM: x11
    EXTRA: ''
  script:
    # - scons -j64 platform=$PLATFORM bits=64 target=release_debug $EXTRA
    - scons -j64 platform=$PLATFORM tools=no bits=64 target=release_debug $EXTRA
    - scons -j64 platform=$PLATFORM tools=no bits=64 target=release $EXTRA
  artifacts:
    name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
    paths:
      - bin/

build_ubuntu:
  extends: .build
  before_script:
    - apt-get update -qq && apt-get install -y -qq build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev
      libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libfreetype6-dev libssl-dev libudev-dev
      libxi-dev libxrandr-dev yasm

build_windows:
  extends: .build
  before_script:
    - apt-get update -qq && apt-get install -y -qq build-essential scons 
      pkg-config yasm mingw-w64
  variables:
    PLATFORM: windows

## The OSX build is deactivated because it's not working.
## Building for OSX sucks.
# build_osx:
#   tags:
#     - linux
#     - threadripper
#   extends: .build
#   image: osxcross
#   variables:
#     PLATFORM: osx
#     OSXCROSS_ROOT: /opt/osxcross
#     DARWIN: darwin15
#     EXTRA: osxcross_sdk=$DARWIN
#   before_script:
#     - apt-get update -qq && apt-get install -y -qq scons pkg-config yasm

# prototype deploy job
.deploy_base:
  stage: deploy
  image: netroby/alpine-rsync:latest
  only:
    refs:
      - dev/common

deploy_opengrok:
  dependencies: []
  extends: .deploy_base
  tags:
    - opengrok
  script:
    - mkdir -p /mnt/opengrok/marte-engine
    - rsync -av --exclude='/.git/' --exclude='/doc/' --delete ./ /mnt/opengrok/marte-engine

# Deploy on treasurechest
deploy_treasurechest:
  extends: .deploy_base
  tags:
    - covoluna
  image: python:3-alpine
  variables:
    TREASURECHEST_PWD: $TREASURECHEST_PWD
  script:
    - pip install -r gitlab-ci/requirements.txt
    - ls -la bin/
    - python gitlab-ci/upload_treasurechest.py bin/* #bin/godot.windows.opt.64.exe bin/godot.x11.opt.64 bin/godot.osx.opt.64 

gitlab-ci/.gitignore

0 → 100644
+1 −0
Original line number Diff line number Diff line
/venv/
+1 −0
Original line number Diff line number Diff line
pyocclient>=0.4
 No newline at end of file
+20 −0
Original line number Diff line number Diff line
#!/usr/bin/env python 
import sys
import os
import owncloud


if __name__ == "__main__":
    if len(sys.argv) < 2:
        raise RuntimeError("It takes at least one argument: the files to upload")
    
    oc = owncloud.Client('https://treasurechest.covolunablu.org/')
    oc.login('experiencearchitects', os.environ['TREASURECHEST_PWD'])

    for upload_file_path in sys.argv[1:]:
        upload_file = os.path.basename(upload_file_path)
        print("uploading {}".format(upload_file))

        oc.put_file('marte-engine/{}'.format(upload_file), upload_file_path)

    print("Finished")