.gitlab-ci.yml 1.63 KB
Newer Older
torgiren's avatar
ci    
torgiren committed
1
---
torgiren's avatar
ci test    
torgiren committed
2
stages:
torgiren's avatar
Devel    
torgiren committed
3
4
  - checks
  - pack
torgiren's avatar
ci test    
torgiren committed
5
6
  - upload

torgiren's avatar
Devel    
torgiren committed
7
8
upload_all:
  stage: upload
torgiren's avatar
ci    
torgiren committed
9
10
11
  #image: curlimages/curl:latest
  image:
    name: alpine/helm:3.2.1
torgiren's avatar
Devel    
torgiren committed
12
  script:
torgiren's avatar
ci    
torgiren committed
13
14
15
16
17
18
19
    - helm registry login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - sh -ec 'for i in $(ls */Chart.yaml); do         chart=$(dirname $i);         helm chart save ${chart} $CI_REGISTRY/${chart};         helm chart push $CI_REGISTRY/${chart}         done'
    #- helm chart save helloworld /gitlabUser/helloworld:
    #- helm chart push /gitlabUser/helloworld:
    #- 'for char in *tgz; do curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@${chart}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"; done'
#  only:
#    - master
torgiren's avatar
Devel    
torgiren committed
20

torgiren's avatar
ci    
torgiren committed
21
22
23
24
check_ci_script:
  stage: .pre
  image: bash
  script:
torgiren's avatar
ci    
torgiren committed
25
    - sh -ec 'for i in $(ls */Chart.yaml); do chart=$(dirname $i); grep "^build_${chart}:" .gitlab-ci.yml; done'
torgiren's avatar
ci    
torgiren committed
26
27


torgiren's avatar
Devel    
torgiren committed
28
29
30
31
32
versions_check_exphost:
  stage: checks
  image: curlimages/curl:latest
  script:
    - 'VER=$(grep "^version: " exphost/Chart.yaml|cut -f 2 -d":"|tr -d " ")'
torgiren's avatar
ci    
torgiren committed
33
    - echo "${VER}"
torgiren's avatar
ci    
torgiren committed
34
    - export VER; sh -c 'curl -v https://gitlab.home.exphost.pl/api/v4/projects/6/packages/helm/stable/charts/exphost-${VER}.tgz --output /dev/null --fail; [ $? -gt 0 ]'
torgiren's avatar
ci    
torgiren committed
35
  only:
torgiren's avatar
ci    
torgiren committed
36
    changes:
torgiren's avatar
ci    
torgiren committed
37
      - exphost/**/*
torgiren's avatar
ci    
torgiren committed
38
39
40
41
42
43
44

lint_exphost:
  stage: checks
  image: alpine/helm:latest
  before_script:
  script:
    - helm lint exphost
torgiren's avatar
ci    
torgiren committed
45
46
  only:
    changes:
torgiren's avatar
ci    
torgiren committed
47
      - exphost/**/*
torgiren's avatar
ci test    
torgiren committed
48

torgiren's avatar
Devel    
torgiren committed
49
50
51
build_exphost:
  stage: pack
  image: alpine/helm:latest
torgiren's avatar
ci test    
torgiren committed
52
  before_script:
torgiren's avatar
ci test    
torgiren committed
53
  script:
torgiren's avatar
ci test    
torgiren committed
54
    - helm package exphost
torgiren's avatar
ci test    
torgiren committed
55
56
  artifacts:
    paths:
torgiren's avatar
Devel    
torgiren committed
57
      - "exphost-*.tgz"
torgiren's avatar
ci    
torgiren committed
58
59
60
#  only:
#    changes:
#      - exphost/**/*