|
1 |
| -defaults: &defaults |
2 |
| - machine: |
3 |
| - services: |
4 |
| - - docker |
5 |
| - steps: |
6 |
| - - checkout |
7 |
| - - run: |
8 |
| - name: "Setup required directories" |
9 |
| - command: | |
10 |
| - mkdir -p /tmp/apache-cloudstack |
11 |
| - mkdir -p /tmp/.m2 |
12 |
| - - restore_cache: |
13 |
| - key: repo-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-m2 |
14 |
| - - run: |
15 |
| - name: "Build Docker image" |
16 |
| - command: make ${TAG} |
17 |
| - - run: |
18 |
| - name: "Test Docker image" |
19 |
| - command: | |
20 |
| - if [ "${TAG}" = "centos6" ]; then exit 0; fi |
21 |
| - docker run \ |
22 |
| - --volume /tmp/apache-cloudstack:/mnt/build \ |
23 |
| - --volume /tmp/.m2:/root/.m2 \ |
24 |
| - --rm \ |
25 |
| - ${IMAGE}:${TAG} \ |
26 |
| - --git-remote https://github.com/apache/cloudstack.git \ |
27 |
| - --git-ref refs/heads/master \ |
28 |
| - --remove-first \ |
29 |
| - ${PARAMS} |
30 |
| - - save_cache: |
31 |
| - key: repo-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-m2 |
32 |
| - paths: |
33 |
| - - /tmp/.m2 |
| 1 | +version: 2.1 |
34 | 2 |
|
35 |
| -version: 2 |
36 | 3 | jobs:
|
37 |
| - centos6: |
38 |
| - <<: *defaults |
39 |
| - environment: |
40 |
| - IMAGE: khos2ow/cloudstack-rpm-builder |
41 |
| - TAG: centos6 |
42 |
| - PARAMS: --distribution centos63 |
| 4 | + test: |
| 5 | + parameters: |
| 6 | + tag: |
| 7 | + type: string |
| 8 | + ref: |
| 9 | + type: string |
| 10 | + param: |
| 11 | + type: string |
| 12 | + docker: |
| 13 | + - image: circleci/buildpack-deps:stretch |
| 14 | + steps: |
| 15 | + - checkout |
| 16 | + - setup_remote_docker |
| 17 | + - run: |
| 18 | + name: "Setup required directories" |
| 19 | + command: | |
| 20 | + mkdir -p /tmp/apache-cloudstack |
| 21 | + mkdir -p /tmp/.m2 |
| 22 | + - restore_cache: |
| 23 | + key: repo-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-m2 |
| 24 | + - run: |
| 25 | + name: "Build Docker image" |
| 26 | + command: make <<parameters.tag>> |
| 27 | + - run: |
| 28 | + name: "Test Docker image" |
| 29 | + command: | |
| 30 | + docker run \ |
| 31 | + --volume /tmp/apache-cloudstack:/mnt/build \ |
| 32 | + --volume /tmp/.m2:/root/.m2 \ |
| 33 | + --rm \ |
| 34 | + khos2ow/cloudstack-rpm-builder:<<parameters.tag>> \ |
| 35 | + --git-remote https://github.com/apache/cloudstack.git \ |
| 36 | + --git-ref <<parameters.ref>> \ |
| 37 | + --remove-first \ |
| 38 | + <<parameters.param>> |
| 39 | + - save_cache: |
| 40 | + key: repo-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-m2 |
| 41 | + paths: |
| 42 | + - /tmp/.m2 |
43 | 43 |
|
44 |
| - centos7: |
45 |
| - <<: *defaults |
46 |
| - environment: |
47 |
| - IMAGE: khos2ow/cloudstack-rpm-builder |
48 |
| - TAG: centos7 |
49 |
| - PARAMS: --distribution centos7 |
50 |
| - |
51 |
| - latest: |
52 |
| - <<: *defaults |
53 |
| - environment: |
54 |
| - IMAGE: khos2ow/cloudstack-rpm-builder |
55 |
| - TAG: centos7 |
56 |
| - PARAMS: --distribution centos7 |
| 44 | + push: |
| 45 | + parameters: |
| 46 | + tag: |
| 47 | + type: string |
| 48 | + docker: |
| 49 | + - image: circleci/buildpack-deps:stretch |
| 50 | + steps: |
| 51 | + - checkout |
| 52 | + - setup_remote_docker |
| 53 | + - run: |
| 54 | + name: Push docker image |
| 55 | + command: | |
| 56 | + echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin |
| 57 | + DOCKER_TAG=<<parameters.tag>> make <<parameters.tag>> push |
57 | 58 |
|
58 | 59 | workflows:
|
59 | 60 | version: 2
|
| 61 | + test: |
| 62 | + jobs: |
| 63 | + - test: |
| 64 | + name: test-centos6 |
| 65 | + tag: centos6 |
| 66 | + ref: refs/heads/4.13 |
| 67 | + param: --distribution centos63 |
| 68 | + filters: |
| 69 | + branches: |
| 70 | + ignore: master |
| 71 | + |
| 72 | + - test: |
| 73 | + name: test-centos7 |
| 74 | + tag: centos7 |
| 75 | + ref: refs/heads/4.13 |
| 76 | + param: --distribution centos7 |
| 77 | + filters: |
| 78 | + branches: |
| 79 | + ignore: master |
| 80 | + |
| 81 | + - test: |
| 82 | + name: test-latest |
| 83 | + tag: centos7 |
| 84 | + ref: refs/heads/4.13 |
| 85 | + param: --distribution centos7 |
| 86 | + filters: |
| 87 | + branches: |
| 88 | + ignore: master |
| 89 | + |
60 | 90 | build:
|
61 | 91 | jobs:
|
62 |
| - - centos6: |
| 92 | + - push: |
| 93 | + name: push-centos6 |
| 94 | + tag: centos6 |
63 | 95 | filters:
|
64 |
| - tags: |
65 |
| - only: /v.*/ |
| 96 | + branches: |
| 97 | + only: master |
66 | 98 |
|
67 |
| - - centos7: |
| 99 | + - push: |
| 100 | + name: push-centos7 |
| 101 | + tag: centos7 |
68 | 102 | filters:
|
69 |
| - tags: |
70 |
| - only: /v.*/ |
| 103 | + branches: |
| 104 | + only: master |
| 105 | + ignore: /.*/ |
71 | 106 |
|
72 |
| - - latest: |
| 107 | + - push: |
| 108 | + name: push-latest |
| 109 | + tag: latest |
73 | 110 | filters:
|
74 |
| - tags: |
75 |
| - only: /v.*/ |
| 111 | + branches: |
| 112 | + only: master |
0 commit comments