|
1 | 1 | language: python |
2 | | -cache: pip |
| 2 | +cache: |
| 3 | + pip: true |
| 4 | + directories: |
| 5 | + - /home/travis/.rvm/gems |
3 | 6 | # env: |
4 | 7 | # - PR_AUTHOR=${TRAVIS_PULL_REQUEST_SLUG::-15} |
5 | 8 | git: |
|
8 | 11 | allow_failures: |
9 | 12 | env: |
10 | 13 | - CAN_FAIL=true |
| 14 | + |
11 | 15 | include: |
12 | | - # fail if asciidoctor encounters errors |
13 | | - - stage: validate |
14 | | - name: "Validate updated assemblies with Asciidoctor" |
| 16 | + - stage: cache-and-validate |
| 17 | + name: "Create install cache and validate updated assemblies" |
15 | 18 | install: |
16 | | - - gem install asciidoctor |
17 | | - - gem install asciidoctor-diagram |
18 | | - - gem install rouge |
| 19 | + - gem install asciidoctor asciidoctor-diagram rouge |
| 20 | + - pip3 install pyyaml aura.tar.gz |
19 | 21 | script: |
20 | | - - chmod +x ./scripts/check-asciidoctor-build.sh |
21 | | - - ./scripts/check-asciidoctor-build.sh |
| 22 | + # Fail if Asciidoctor encounters errors. Run only if there are modified AsciiDoc files |
| 23 | + - if ! [[ -z $(git diff --name-only HEAD~1 HEAD --diff-filter=d '*.adoc' ':(exclude)_unused_topics/*') ]]; then chmod +x ./scripts/check-asciidoctor-build.sh && ./scripts/check-asciidoctor-build.sh; fi |
| 24 | + |
22 | 25 | - stage: build |
| 26 | + if: branch IN (main, enterprise-4.13, enterprise-4.14) |
23 | 27 | name: "Build openshift-enterprise distro" |
24 | | - before_install: |
25 | | - - gem install asciidoctor |
26 | | - - gem install asciidoctor-diagram |
27 | | - install: |
28 | | - - pip3 install pyyaml |
29 | | - - pip3 install aura.tar.gz |
30 | 28 | script: |
31 | 29 | - python3 build.py --distro openshift-enterprise --product "OpenShift Container Platform" --version 4.14 --no-upstream-fetch && python3 makeBuild.py |
| 30 | + |
32 | 31 | - # stage name not required, will continue to use `build` |
33 | 32 | if: branch IN (main, enterprise-4.13, enterprise-4.14) |
34 | 33 | name: "Build openshift-dedicated distro" |
35 | | - before_install: |
36 | | - - gem install asciidoctor |
37 | | - - gem install asciidoctor-diagram |
38 | | - install: |
39 | | - - pip3 install pyyaml |
40 | | - - pip3 install aura.tar.gz |
41 | 34 | script: |
42 | 35 | - python3 build.py --distro openshift-dedicated --product "OpenShift Dedicated" --version 4 --no-upstream-fetch && python3 makeBuild.py |
| 36 | + |
43 | 37 | - # stage name not required, will continue to use `build` |
44 | 38 | if: branch IN (main, enterprise-4.13, enterprise-4.14) |
45 | 39 | name: "Build openshift-rosa distro" |
46 | | - before_install: |
47 | | - - gem install asciidoctor |
48 | | - - gem install asciidoctor-diagram |
49 | | - install: |
50 | | - - pip3 install pyyaml |
51 | | - - pip3 install aura.tar.gz |
52 | 40 | script: |
53 | 41 | - python3 build.py --distro openshift-rosa --product "Red Hat OpenShift Service on AWS" --version 4 --no-upstream-fetch && python3 makeBuild.py |
| 42 | + |
54 | 43 | - # stage name not required, will continue to use `build` |
55 | 44 | if: branch IN (main, enterprise-4.13, enterprise-4.14) |
56 | 45 | name: "Build microshift distro" |
57 | | - before_install: |
58 | | - - gem install asciidoctor |
59 | | - - gem install asciidoctor-diagram |
60 | | - install: |
61 | | - - pip3 install pyyaml |
62 | | - - pip3 install aura.tar.gz |
63 | 46 | script: |
64 | | - - python3 build.py --distro microshift --product "MicroShift" --version 4 --no-upstream-fetch && python3 makeBuild.py |
| 47 | + - python3 build.py --distro microshift --product "Microshift" --version 4 --no-upstream-fetch && python3 makeBuild.py |
| 48 | + |
65 | 49 | # Remove Vale stage until PR commenting feature is ready |
66 | 50 | # - stage: check-with-vale |
67 | 51 | # env: |
68 | 52 | # - CAN_FAIL=true |
69 | 53 | # if: type IN (pull_request) AND sender != "openshift-cherrypick-robot" |
70 | 54 | # name: "Run Vale against PR asciidoc files" |
71 | 55 | # language: minimal |
72 | | - # before_script: |
73 | | - # - gem install asciidoctor |
74 | 56 | # script: |
75 | 57 | # - travis_retry wget https://github.com/errata-ai/vale/releases/download/v2.15.4/vale_2.15.4_Linux_64-bit.tar.gz --retry-connrefused |
76 | 58 | # - mkdir bin && tar -xvzf vale_2.15.4_Linux_64-bit.tar.gz -C bin |
77 | 59 | # - export PATH=./bin:"$PATH" |
78 | 60 | # - travis_retry vale sync # pull down VRH rules package |
79 | 61 | # - chmod +x ./scripts/check-with-vale.sh |
80 | | - # - ./scripts/check-with-vale.sh |
| 62 | + # - ./scripts/check-with-vale.sh; fi |
| 63 | + |
81 | 64 | # Commenting out to disable auto-merging of PRs |
82 | 65 | # - stage: automerge |
83 | 66 | # if: env(PR_AUTHOR)=openshift-cherrypick-robot |
84 | 67 | # script: bash ./automerge.sh |
| 68 | + |
85 | 69 | - stage: netlify |
| 70 | + name: "Build and deploy with Netlify" |
86 | 71 | env: |
87 | 72 | - CAN_FAIL=true |
88 | 73 | language: minimal |
89 | 74 | if: type IN (pull_request) AND branch IN (main, enterprise-4.13, enterprise-4.14) AND sender != "openshift-cherrypick-robot" |
90 | 75 | script: |
91 | | - - chmod +x autopreview.sh && ./autopreview.sh |
| 76 | + - chmod +x autopreview.sh |
| 77 | + - ./autopreview.sh |
92 | 78 |
|
93 | 79 | stages: |
94 | | - - validate |
| 80 | + - cache-and-validate |
95 | 81 | - build |
96 | 82 | - netlify |
97 | 83 | #- check-with-vale |
|
0 commit comments