.gitlab-ci.yml 1.81 KB
Newer Older
David Yu Yuan's avatar
David Yu Yuan committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#######
# GKE #
#######
freebayes-gke:
  variables:
    CI_TARGET_NAME: gcp
    CI_SOURCE_IMAGE: freebayes
  extends: .docker.image

samtools-gke:
  variables:
    CI_TARGET_NAME: gcp
    CI_SOURCE_IMAGE: samtools
  extends: .docker.image

build-gke:
  stage: build
  script:
    - ${CI_PROJECT_DIR}/gcp/sdk.sh | tee ${ARTIFACT_DIR}/sdk.log
    - ${CI_PROJECT_DIR}/gcp/gke.sh | tee ${ARTIFACT_DIR}/gke.log
    - ${CI_PROJECT_DIR}/check.k8s.sh | tee ${ARTIFACT_DIR}/check.k8s.log
  artifacts:
    when: always
    name: "$CI_COMMIT_REF_NAME-$CI_JOB_STAGE-$CI_JOB_NAME"
    paths:
      - ${ARTIFACT_DIR}

deploy-gke:
  stage: deploy
  script:
    - ${CI_PROJECT_DIR}/gcp/sdk.sh | tee ${ARTIFACT_DIR}/sdk.log
    - ${CI_PROJECT_DIR}/gcp/nfs-client.sh | tee ${ARTIFACT_DIR}/nfs-client.log
#    - ${CI_PROJECT_DIR}/gcp/sfs/freebayes.sh | tee ${ARTIFACT_DIR}/freebayes.log
    - ${CI_PROJECT_DIR}/gcp/dpm/freebayes.sh | tee ${ARTIFACT_DIR}/freebayes.log
  artifacts:
    when: always
    name: "$CI_COMMIT_REF_NAME-$CI_JOB_STAGE-$CI_JOB_NAME"
    paths:
      - ${ARTIFACT_DIR}
  dependencies:
    - build-gke
  environment:
    name: Google
    url: https://console.cloud.google.com/
    on_stop: erase-gke

erase-gke:
  stage: deploy
  script:
    - ${CI_PROJECT_DIR}/gcp/sdk.sh | tee ${ARTIFACT_DIR}/sdk.log
#    - ${CI_PROJECT_DIR}/gcp/sfs/freebayes.rm.sh | tee ${ARTIFACT_DIR}/freebayes.rm.log
    - ${CI_PROJECT_DIR}/gcp/dpm/freebayes.rm.sh | tee ${ARTIFACT_DIR}/freebayes.rm.log
    - ${CI_PROJECT_DIR}/gcp/nfs-client.rm.sh | tee ${ARTIFACT_DIR}/nfs-client.rm.log
    - ${CI_PROJECT_DIR}/gcp/gke.rm.sh | tee ${ARTIFACT_DIR}/gke.rm.log
  when: manual
  artifacts:
    when: always
    name: "$CI_COMMIT_REF_NAME-$CI_JOB_STAGE-$CI_JOB_NAME"
    paths:
      - ${ARTIFACT_DIR}
  dependencies:
    - build-gke
  environment:
    name: Google
    action: stop