# See https://docs.gitlab.com/ee/ci/yaml/index.html for all available options

stages:
  - test
  - builddeploy

image:
    name: quay.io/singularity/singularity:v3.8.4
    entrypoint: [ "" ]


.templateTest:
  stage: test
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      when: manual
  tags:
    - docker7
  script:
    - singularity build container.sif $RECIPE_PATH/Singularity.$BASENAME-$TAG


.templateBuildDeploy:
  stage: builddeploy
  tags:
    - docker7
  only:
    - if: $CI_COMMIT_BRANCH == "main"
  script:
    - singularity build container.sif $RECIPE_PATH/Singularity.$BASENAME-$TAG
    - singularity push --docker-username gitlab-ci-token --docker-password $CI_JOB_TOKEN container.sif oras://"$CI_REGISTRY_IMAGE"/$BASENAME:$TAG

#####################
## Submission area
#####################

## WRITE YOUR TEST RULE HERE AFTER BRANCHING ON SUBMISSION AND CREATE A MERGE REQUEST


    
#####################
# Image analysis
#####################

include:
  - local: "yaml-files/image-analysis/deeplabcut-deploy.yaml"

#####################
# Quality control
#####################

include:
  - local: "yaml-files/quality-control/fastqc-deploy.yaml"


#####################
# Mapping
#####################

include:
  - local: "yaml-files/mapping/bowtie2-deploy.yaml"


#####################
# Analysis suites
#####################

include:
  - local: "yaml-files/analysis-suites/deeptools-deploy.yaml"


#####################
# Peaks callers
#####################

include:
  - local: "yaml-files/peakcallers/hiddendomains-deploy.yaml"
  - local: "yaml-files/peakcallers/macs2-deploy.yaml"
