variables: RSYNC_OPTS: --recursive --ignore-missing-args --chown ${DEPLOY_USER}:${DEPLOY_USER} DOCKER_TAG: ${CI_COMMIT_REF_NAME} DOCKER_IMAGE: rwthacs/dpsim DOCKER_IMAGE_DEV: rwthacs/dpsim-dev before_script: - git config --local core.longpaths true - git submodule sync --recursive - git submodule update --init --recursive stages: - prepare - build - test - generate - deploy docker: stage: prepare script: - docker build --file Packaging/Docker/Dockerfile.dev --tag ${DOCKER_IMAGE_DEV}:${DOCKER_TAG} --tag ${DOCKER_IMAGE_DEV}:latest . # build dedicated jupyter image in the future - docker build --file Packaging/Docker/Dockerfile.jupyter --build-arg DOCKER_IMAGE=${DOCKER_IMAGE_DEV} --build-arg DOCKER_TAG=${DOCKER_TAG} --tag ${DOCKER_IMAGE_DEV}-jupyter:${DOCKER_TAG} --tag ${DOCKER_IMAGE_DEV}-jupyter:latest . tags: - shell - linux build:linux: stage: build script: - mkdir -p build - cd build - cmake .. - make -j 32 image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG} cache: paths: - build key: build-linux artifacts: paths: - build tags: - docker build:windows: stage: build script: - New-Item -ItemType Directory -Force -Path build - Set-Location -Path build # 64 Bit Graphviz Builds for Windows: # https://ci.appveyor.com/project/ellson/graphviz-pl238/ - cmake .. -DGraphviz_ROOT="C:/Program Files/Graphviz 2.41.20190716.1839" - cmake --build . -j 24 tags: - win10 cache: paths: - build key: build-win10 #build:macos: # stage: build # script: # - mkdir -p build # - cd build # - cmake -DCMAKE_C_COMPILER=/usr/local/bin/gcc-9 # -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-9 # -DWITH_CIM_SUBMODULE=ON # -DWITH_SUNDIALS=OFF .. # - make -j $(sysctl -n hw.ncpu) # cache: # paths: # - build # key: build-macos # artifacts: # paths: # - build # tags: # - mac #test:pytest: # stage: test # variables: # PYTHONPATH: "build/Source/Python:Source/Python" # script: # - pytest -v Examples/CIM/test_CIM.yml # - pytest -v Examples/Cxx/test_Circuits.yml # - pytest -v Examples/Cxx/test_RealTime.yml # #- pytest -v Examples/Cxx/test_Shmem.yml # - pytest -v Examples/Python/Base # - pytest -v Examples/Python/Circuits # - pytest -v Examples/Python/RealTime # #- pytest -v Examples/Python/Shmem # image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG} # dependencies: # - build:linux # tags: # - docker generate:docs: stage: generate script: - make -j$(nproc) -C build docs - make -j$(nproc) -C build docs_cxx image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG} dependencies: - build:linux artifacts: paths: - build/docs/sphinx/html - build/docs/doxygen/html tags: - docker generate:packages: stage: generate script: - make -j$(nproc) -C build package only: - tags tags: - docker image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG} dependencies: - build:linux artifacts: paths: - build/*.rpm - build/*.tar.gz build:docker: stage: build script: - docker build --file Packaging/Docker/Dockerfile --build-arg DOCKER_TAG=${DOCKER_TAG} --build-arg CI=1 --build-arg CI_COMMIT_SHA=${CI_COMMIT_SHA} --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME} --build-arg CI_COMMIT_TAG=${CI_COMMIT_TAG} --tag ${DOCKER_IMAGE}:${DOCKER_TAG} --tag ${DOCKER_IMAGE}:latest . tags: - shell - linux only: - tags test:jupyter: stage: test variables: PYTHONPATH: "build/Source/Python:Source/Python" script: - pytest -v Examples/Notebooks image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG} dependencies: - build:linux tags: - docker artifacts: paths: - outputs/Examples/Notebooks/ # Stage deploy ############################################################################## pages: stage: deploy script: - cp -r build/docs/sphinx/html/. public/sphinx - cp -r build/docs/doxygen/html/. public/doxygen artifacts: paths: - public dependencies: - generate:docs only: - deploy tags: - shell - linux deploy:docker: stage: deploy script: - docker push ${DOCKER_IMAGE_DEV}:${DOCKER_TAG} - docker push ${DOCKER_IMAGE_DEV}:latest - docker push ${DOCKER_IMAGE}:${DOCKER_TAG} - docker push ${DOCKER_IMAGE}:latest dependencies: - build:docker tags: - shell - linux only: - tags deploy:packages: stage: deploy script: - rsync ${RSYNC_OPTS} build/*.rpm ${DEPLOY_USER}@${DEPLOY_HOST}:/var/www/packages/fedora/29/x86_64 - rsync ${RSYNC_OPTS} build/*.tar.gz ${DEPLOY_USER}@${DEPLOY_HOST}:/var/www/dpsim/src - ssh ${DEPLOY_USER}@${DEPLOY_HOST} createrepo /var/www/packages/fedora/29 dependencies: - generate:packages only: - tags tags: - fein-deploy - shell - linux