From 1e31aeff6ba6cef0f249108c8c32009ee708b21b Mon Sep 17 00:00:00 2001
From: Amir MOHAMMADI <amir.mohammadi@idiap.ch>
Date: Wed, 21 Feb 2018 13:31:12 +0100
Subject: [PATCH] Move to the new CI format

---
 .gitlab-ci.yml   |  99 ++++++++++++++++++++++++++++--------------
 README.rst       |  15 +++++++
 conda/meta.yaml  | 110 +++++++++++++++++++++++++++++++++++++++++++++++
 requirements.txt |  80 ----------------------------------
 setup.py         |  35 ---------------
 version.txt      |   2 +-
 6 files changed, 192 insertions(+), 149 deletions(-)
 create mode 100644 conda/meta.yaml
 delete mode 100644 requirements.txt
 delete mode 100644 setup.py

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 46e7b05..a1f2517 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,57 +1,90 @@
-# Definition of our build pipeline
+# This build file uses template features from YAML so it is generic enough for
+# any Bob project. Don't modify it unless you know what you're doing.
+
+# Definition of global variables (all stages)
+variables:
+  CONDA_ROOT: "${CI_PROJECT_DIR}/miniconda"
+
+
+# Definition of our build pipeline order
 stages:
   - build
   - deploy
 
-# ---------
-# Templates
-# ---------
 
-# Template for the build stage
-# Needs to run on all supported architectures, platforms and python versions
+# Build targets
 .build_template: &build_job
   stage: build
   before_script:
-    - ./before_build.sh
+    - mkdir _ci
+    - curl --silent "https://gitlab.idiap.ch/bob/bob.admin/raw/master/gitlab/install.sh" > _ci/install.sh
+    - chmod 755 _ci/install.sh
+    - ./_ci/install.sh _ci master #installs ci support scripts
     - ./_ci/before_build.sh
+    - ./before_build.sh
   script:
     - ./_ci/build.sh
   after_script:
     - ./_ci/after_build.sh
-  artifacts:
-    expire_in: 1 week
+  cache: &build_caches
     paths:
-      - sphinx/
+      - miniconda.sh
+      - ${CONDA_ROOT}/pkgs/*.tar.bz2
+      - ${CONDA_ROOT}/pkgs/urls.txt
 
 
-# Template for (latest) documentation upload stage
-# Only one real job needs to do this
-.docs_template: &docs_job
-  stage: deploy
-  environment: intranet
-  only:
-    - master
-  before_script:
-    - ./_ci/before_docs.sh
-  script:
-    - ./_ci/docs.sh
-  after_script:
-    - ./_ci/after_docs.sh
+.build_linux_template: &linux_build_job
+  <<: *build_job
+  tags:
+    - docker
+  image: continuumio/conda-concourse-ci
+  artifacts:
+    expire_in: 1 week
+    paths:
+      - _ci/
+      - ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2
+  cache:
+    <<: *build_caches
+    key: "linux-cache"
 
 
-# Linux + Python 3.6
 build_linux_36:
-  <<: *build_job
-  variables: &linux_36_build_variables
+  <<: *linux_build_job
+  variables:
     PYTHON_VERSION: "3.6"
-    WHEEL_TAG: "py3"
-  tags:
-    - conda-linux
+    BUILD_EGG: "true"
+  artifacts:
+    expire_in: 1 week
+    paths:
+      - _ci/
+      - sphinx
+      - ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2
+
 
-docs_linux_36:
-  <<: *docs_job
-  variables: *linux_36_build_variables
+# Deploy targets
+.deploy_template: &deploy_job
+  stage: deploy
+  before_script:
+    - ./_ci/install.sh _ci master #updates ci support scripts
+  script:
+    - ./_ci/deploy.sh
   dependencies:
     - build_linux_36
   tags:
-    - conda-linux
+    - deployer
+
+
+deploy_beta:
+  <<: *deploy_job
+  environment: beta
+  only:
+    - master
+
+
+deploy_stable:
+  <<: *deploy_job
+  environment: stable
+  only:
+    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
+  except:
+    - branches
diff --git a/README.rst b/README.rst
index aabc647..377a4e9 100644
--- a/README.rst
+++ b/README.rst
@@ -1,2 +1,17 @@
+******************************************
+Bob's Documentation Aggregation Repository
+******************************************
+
 This repository will build the documentation of all Bob packages at the same
 time.
+
+Adding a new package
+====================
+
+To add a new package:
+
+* Make sure the package is **public** first. Do not add private packages here.
+* Add it in ``conda/meta.yaml``.
+* Add it in ``doc/index.rst``.
+* If it plots something using matplotlib during its documentation generation,
+  make sure you add a symlink for it in the docs folder.
diff --git a/conda/meta.yaml b/conda/meta.yaml
new file mode 100644
index 0000000..fe58bc4
--- /dev/null
+++ b/conda/meta.yaml
@@ -0,0 +1,110 @@
+{% set name = 'docs' %}
+{% set project_dir = environ.get('RECIPE_DIR') + '/..' %}
+
+package:
+  name: {{ name }}
+  version: {{ environ.get('BOB_PACKAGE_VERSION', '0.0.1') }}
+
+build:
+  number: {{ environ.get('BOB_BUILD_NUMBER', 0) }}
+
+requirements:
+  run:
+    - python
+    - setuptools
+    - bob.extension
+    - bob.blitz
+    - bob.core
+    - bob.io.base
+    - bob.sp
+    - bob.ap
+    - bob.math
+    - bob.measure
+    - bob.io.image
+    - bob.db.base
+    - bob.io.video
+    - bob.io.matlab
+    - bob.io.audio
+    - bob.ip.base
+    - bob.ip.color
+    - bob.ip.draw
+    - bob.ip.gabor
+    - bob.learn.activation
+    - bob.learn.libsvm
+    - bob.learn.linear
+    - bob.learn.mlp
+    - bob.learn.em
+    - bob.learn.boosting
+    - bob.db.iris
+    - bob.db.wine
+    - bob.db.mnist
+    - bob.db.atnt
+    - bob.ip.facedetect
+    - bob.ip.optflow.hornschunck
+    - bob.ip.optflow.liu
+    - bob.ip.flandmark
+    - bob
+    - gridtk
+    - bob.ip.qualitymeasure
+    - bob.ip.skincolorfilter
+    - bob.ip.facelandmarks
+    - bob.ip.dlib
+    - bob.db.arface
+    - bob.db.asvspoof
+    - bob.db.asvspoof2017
+    - bob.db.atvskeystroke
+    - bob.db.avspoof
+    - bob.db.banca
+    - bob.db.biosecure
+    - bob.db.biosecurid.face
+    - bob.db.casme2
+    - bob.db.caspeal
+    - bob.db.cohface
+    - bob.db.frgc
+    - bob.db.gbu
+    - bob.db.hci_tagging
+    - bob.db.ijba
+    - bob.db.kboc16
+    - bob.db.lfw
+    - bob.db.livdet2013
+    - bob.db.mobio
+    - bob.db.msu_mfsd_mod
+    - bob.db.multipie
+    - bob.db.nist_sre12
+    - bob.db.putvein
+    - bob.db.replay
+    - bob.db.replaymobile
+    - bob.db.scface
+    - bob.db.utfvp
+    - bob.db.verafinger
+    - bob.db.fv3d
+    - bob.db.voicepa
+    - bob.db.xm2vts
+    - bob.db.youtube
+    - bob.db.pericrosseye
+    - bob.db.cuhk_cufs
+    - bob.bio.base
+    - bob.bio.gmm
+    - bob.bio.face
+    - bob.bio.spear
+    - bob.bio.video
+    - bob.bio.vein
+    - bob.db.voxforge
+    - bob.pad.base
+    - bob.pad.face
+
+test:
+  commands:
+    - sphinx-build {{ project_dir }}/doc {{ project_dir }}/sphinx
+  requires:
+    - bob-devel {{ bob_devel }}.*
+    - nose
+    - coverage
+    - sphinx
+    - sphinx_rtd_theme
+
+about:
+  home: https://www.idiap.ch/software/bob/
+  license: BSD-3-Clause
+  summary: Bob's documentation aggregation repository
+  license_family: BSD
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index e5c5122..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1,80 +0,0 @@
-bob.extension
-bob.blitz
-bob.core
-bob.io.base
-bob.sp
-bob.ap
-bob.math
-bob.measure
-bob.io.image
-bob.db.base
-bob.io.video
-bob.io.matlab
-bob.io.audio
-bob.ip.base
-bob.ip.color
-bob.ip.draw
-bob.ip.gabor
-bob.learn.activation
-bob.learn.libsvm
-bob.learn.linear
-bob.learn.mlp
-bob.learn.em
-bob.learn.boosting
-bob.db.iris
-bob.db.wine
-bob.db.mnist
-bob.db.atnt
-bob.ip.facedetect
-bob.ip.optflow.hornschunck
-bob.ip.optflow.liu
-bob.ip.flandmark
-bob
-gridtk
-bob.ip.qualitymeasure
-bob.ip.skincolorfilter
-bob.ip.facelandmarks
-bob.ip.dlib
-bob.db.arface
-bob.db.asvspoof
-bob.db.asvspoof2017
-bob.db.atvskeystroke
-bob.db.avspoof
-bob.db.banca
-bob.db.biosecure
-bob.db.biosecurid.face
-bob.db.casme2
-bob.db.caspeal
-bob.db.cohface
-bob.db.frgc
-bob.db.gbu
-bob.db.hci_tagging
-bob.db.ijba
-bob.db.kboc16
-bob.db.lfw
-bob.db.livdet2013
-bob.db.mobio
-bob.db.msu_mfsd_mod
-bob.db.multipie
-bob.db.nist_sre12
-bob.db.putvein
-bob.db.replay
-bob.db.replaymobile
-bob.db.scface
-bob.db.utfvp
-bob.db.verafinger
-bob.db.fv3d
-bob.db.voicepa
-bob.db.xm2vts
-bob.db.youtube
-bob.db.pericrosseye
-bob.db.cuhk_cufs
-bob.bio.base
-bob.bio.gmm
-bob.bio.face
-bob.bio.spear
-bob.bio.video
-bob.bio.vein
-bob.db.voxforge
-bob.pad.base
-bob.pad.face
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 9309beb..0000000
--- a/setup.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env python
-# vim: set fileencoding=utf-8 :
-"""A package that builds all the documentations of Bob packages
-"""
-
-from setuptools import setup
-
-# Define package version
-version = open("version.txt").read().rstrip()
-
-setup(
-    name="bob.docs",
-    version=version,
-    description="A package that builds all the documentations of Bob packages",
-    url='http://gitlab.idiap.ch/bob/docs',
-    license="BSD",
-    author='Amir Mohammadi',
-    author_email='amir.mohammadi@idiap.ch',
-    long_description=open('README.rst').read(),
-
-    packages=None,
-    include_package_data=True,
-    zip_safe=False,
-
-    classifiers=[
-        'Framework :: Bob',
-        'Development Status :: 5 - Production/Stable',
-        'Intended Audience :: Developers',
-        'License :: OSI Approved :: BSD License',
-        'Natural Language :: English',
-        'Programming Language :: Python',
-        'Programming Language :: Python :: 3',
-        'Topic :: Software Development :: Libraries :: Python Modules',
-    ],
-)
diff --git a/version.txt b/version.txt
index 8acdd82..4e25753 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-0.0.1
+2018.02.21b0
-- 
GitLab