.gitlab-ci.yml 1.61 KB
Newer Older
Adam Mercer's avatar
Adam Mercer committed
1 2
image: docker:latest

Adam Mercer's avatar
Adam Mercer committed
3
variables:
4
  BASE_REPOSITORY: 'cgca/base'
Adam Mercer's avatar
Adam Mercer committed
5

Adam Mercer's avatar
Adam Mercer committed
6 7
stages:
  - docker
8
  - rebuild
Adam Mercer's avatar
Adam Mercer committed
9 10 11 12 13

docker:build:
  stage: docker
  script:
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
14 15
    - docker build --pull -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME .
    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
16
    - docker logout $CI_REGISTRY
17 18 19 20
    - |
        # push to docker hub
        if [[ $CI_PROJECT_NAMESPACE == 'docker' ]]; then
          docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_TOKEN
21 22
          docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME $BASE_REPOSITORY:$CI_COMMIT_REF_NAME
          docker push $BASE_REPOSITORY:$CI_COMMIT_REF_NAME
23 24
          docker logout
        fi
25

Adam Mercer's avatar
Adam Mercer committed
26
#
27
# trigger rebuilds of downstream containers
Adam Mercer's avatar
Adam Mercer committed
28 29 30
#

# lalsuite-dev
31 32 33

rebuild:lalsuite-dev:
  stage: rebuild
34 35
  only:
    - branches@docker/base
36 37 38
  trigger:
    project: docker/lalsuite-dev
    branch: el7
39

Adam Mercer's avatar
Adam Mercer committed
40 41
# packaging

42 43
rebuild:el7-production:
  stage: rebuild
44 45
  only:
    - branches@docker/base
46 47 48
  trigger:
    project: docker/packaging
    branch: el7-production
49 50 51

rebuild:el7-production-staging:
  stage: rebuild
52 53
  only:
    - branches@docker/base
54 55 56
  trigger:
    project: docker/packaging
    branch: el7-production-staging
57 58 59

rebuild:el7-testing:
  stage: rebuild
60 61
  only:
    - branches@docker/base
62 63 64
  trigger:
    project: docker/packaging
    branch: el7-testing
65 66 67

rebuild:el7-staging:
  stage: rebuild
68 69
  only:
    - branches@docker/base
70 71 72
  trigger:
    project: docker/packaging
    branch: el7-staging
73

74
# ssh container
75

76
rebuild:ssh:
77
  stage: rebuild
78 79
  only:
    - branches@docker/base
80
  trigger:
81
    project: docker/ssh
82
    branch: el7