summaryrefslogtreecommitdiffstats
path: root/.pipeline.yml
blob: 6df315a39709e8655cb26651462fb222f42db129 (plain)
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
---
# yamllint disable rule:line-length
skip_clone: true

pipeline:
  # commit_lint:
  #   image: registry.opensuse.org/home/crameleon/libertacasa/containers/containerfile/libertacasa/pipeline-gommit:latest
  #   secrets: [ci_netrc_username, ci_netrc_password, ci_netrc_machine]
  #   when:
  #     event: [push]
  #   commands:
  #     - git clone --single-branch -b $CI_COMMIT_BRANCH $CI_REPO_LINK ../salt-libertacasa-commit-linting
  #     - cd ../salt-libertacasa-commit-linting
  #     - bin/lint-commits.pl production

  code_lint:
    image: registry.opensuse.org/home/crameleon/libertacasa/containers/containerfile/libertacasa/pipeline-lint:latest
    secrets: [ci_netrc_username, ci_netrc_password, ci_netrc_machine]
    when:
      event: [push]
    commands:
      - git clone --single-branch -b $CI_COMMIT_BRANCH $CI_REPO_LINK ../salt-libertacasa-linting
      - cd ../salt-libertacasa-linting
      - find . -type f \( -name '*.yaml' -o -name '*.yml' \) -exec yamllint -f colored -s {} +
      - find . -name '*.sls' -exec salt-lint --severity -x 204 {} +

  check:
    image: registry.opensuse.org/home/crameleon/libertacasa/containers/containerfile/libertacasa/pipeline:latest
    secrets: [ci_netrc_username, ci_netrc_password, ci_netrc_machine]
    when:
      event: [push]
    commands:
      - git clone --single-branch -b $CI_COMMIT_BRANCH $CI_REPO_LINK .
      - bin/clone_formulas.sh 2>/dev/null
      - bin/nbroles_to_grains.sh
      - bin/prepare_minion.py
      - cat /etc/salt/grains
      - salt-call --local --retcode-passthrough state.show_top
      - salt-call --local --retcode-passthrough state.show_highstate
      - bin/prepare_mock.py
      - salt-call --local --retcode-passthrough state.apply mock=True

  sync_roles:
    image: registry.opensuse.org/home/crameleon/libertacasa/containers/containerfile/libertacasa/rolesyncer:latest
    secrets:
      - source: rolesyncer_nbh
        target: NB_HOST
      - source: rolesyncer_nbt
        target: NB_TOKEN
    when:
      branch: [production]
      event: [push]
      instance: woodpecker-orpheus.intranet.squirrelcube.com
    commands:
      # - rolesyncer
      - bin/rolesyncer.py