|
| 1 | +kind: pipeline |
| 2 | +type: docker |
| 3 | +name: linux-amd64 |
| 4 | + |
| 5 | +platform: |
| 6 | + arch: amd64 |
| 7 | + os: linux |
| 8 | + |
| 9 | +steps: |
| 10 | +- name: test |
| 11 | + image: docker.io/drycc/go-dev |
| 12 | + pull: if-not-exists |
| 13 | + privileged: true |
| 14 | + commands: |
| 15 | + - make docker-build test |
| 16 | + environment: |
| 17 | + VERSION: ${DRONE_TAG:-latest}-linux-amd64 |
| 18 | + DEV_REGISTRY: ${DEV_REGISTRY:-docker.io} |
| 19 | + DRYCC_REGISTRY: ${DRYCC_REGISTRY:-docker.io} |
| 20 | + when: |
| 21 | + event: |
| 22 | + - push |
| 23 | + - tag |
| 24 | + - pull_request |
| 25 | + volumes: |
| 26 | + - name: image_registries |
| 27 | + path: /etc/containers/registries.conf |
| 28 | + |
| 29 | +- name: publish |
| 30 | + image: docker.io/drycc/go-dev |
| 31 | + pull: if-not-exists |
| 32 | + privileged: true |
| 33 | + commands: |
| 34 | + - echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin |
| 35 | + - make docker-build docker-immutable-push |
| 36 | + environment: |
| 37 | + VERSION: ${DRONE_TAG:-latest}-linux-amd64 |
| 38 | + DEV_REGISTRY: |
| 39 | + from_secret: dev_registry |
| 40 | + DRYCC_REGISTRY: |
| 41 | + from_secret: drycc_registry |
| 42 | + DOCKER_USERNAME: |
| 43 | + from_secret: docker_username |
| 44 | + DOCKER_PASSWORD: |
| 45 | + from_secret: docker_password |
| 46 | + when: |
| 47 | + event: |
| 48 | + - push |
| 49 | + - tag |
| 50 | + volumes: |
| 51 | + - name: image_registries |
| 52 | + path: /etc/containers/registries.conf |
| 53 | + |
| 54 | +trigger: |
| 55 | + event: |
| 56 | + - push |
| 57 | + - tag |
| 58 | + - pull_request |
| 59 | + |
| 60 | +volumes: |
| 61 | +- name: image_registries |
| 62 | + host: |
| 63 | + path: /etc/containers/registries.conf |
| 64 | + |
| 65 | +--- |
| 66 | +kind: pipeline |
| 67 | +type: docker |
| 68 | +name: linux-arm64 |
| 69 | + |
| 70 | +platform: |
| 71 | + arch: arm64 |
| 72 | + os: linux |
| 73 | + |
| 74 | +steps: |
| 75 | +- name: publish |
| 76 | + image: docker.io/drycc/go-dev |
| 77 | + pull: if-not-exists |
| 78 | + privileged: true |
| 79 | + commands: |
| 80 | + - echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin |
| 81 | + - make docker-build docker-immutable-push |
| 82 | + environment: |
| 83 | + VERSION: ${DRONE_TAG:-latest}-linux-arm64 |
| 84 | + DEV_REGISTRY: |
| 85 | + from_secret: dev_registry |
| 86 | + DRYCC_REGISTRY: |
| 87 | + from_secret: drycc_registry |
| 88 | + DOCKER_USERNAME: |
| 89 | + from_secret: docker_username |
| 90 | + DOCKER_PASSWORD: |
| 91 | + from_secret: docker_password |
| 92 | + volumes: |
| 93 | + - name: image_registries |
| 94 | + path: /etc/containers/registries.conf |
| 95 | + |
| 96 | +trigger: |
| 97 | + event: |
| 98 | + - push |
| 99 | + - tag |
| 100 | + |
| 101 | +volumes: |
| 102 | +- name: image_registries |
| 103 | + host: |
| 104 | + path: /etc/containers/registries.conf |
| 105 | + |
| 106 | +--- |
| 107 | +kind: pipeline |
| 108 | +type: docker |
| 109 | +name: manifest |
| 110 | + |
| 111 | +steps: |
| 112 | +- name: generate manifest |
| 113 | + image: docker.io/library/alpine |
| 114 | + pull: if-not-exists |
| 115 | + commands: |
| 116 | + - sed -i "s/docker.io/$${DRYCC_REGISTRY}/g" .drone/manifest.tmpl |
| 117 | + environment: |
| 118 | + DRYCC_REGISTRY: |
| 119 | + from_secret: drycc_registry |
| 120 | + |
| 121 | +- name: publish |
| 122 | + image: plugins/manifest |
| 123 | + settings: |
| 124 | + spec: .drone/manifest.tmpl |
| 125 | + username: |
| 126 | + from_secret: docker_username |
| 127 | + password: |
| 128 | + from_secret: docker_password |
| 129 | + environment: |
| 130 | + DEV_REGISTRY: |
| 131 | + from_secret: dev_registry |
| 132 | + DRYCC_REGISTRY: |
| 133 | + from_secret: drycc_registry |
| 134 | + |
| 135 | +trigger: |
| 136 | + event: |
| 137 | + - push |
| 138 | + - tag |
| 139 | + |
| 140 | +depends_on: |
| 141 | +- linux-amd64 |
| 142 | +- linux-arm64 |
| 143 | + |
| 144 | +--- |
| 145 | +kind: pipeline |
| 146 | +type: docker |
| 147 | +name: chart |
| 148 | + |
| 149 | +steps: |
| 150 | +- name: generate chart |
| 151 | + image: docker.io/drycc/python-dev |
| 152 | + commands: |
| 153 | + - IMAGE_TAG=$([ ! -z $DRONE_TAG ] && echo ${DRONE_TAG:1} || echo \"canary\") |
| 154 | + - sed -i "s/image_tag:\ \"canary\"/image_tag:\ $IMAGE_TAG/g" charts/buildparker/values.yaml |
| 155 | + - helm package charts/buildparker --version ${DRONE_TAG:-v1.0.0} |
| 156 | + - curl -u $CHARTMUSEUM_USERNAME:$CHARTMUSEUM_PASSWORD -F chart=@buildparker-${DRONE_TAG:-v1.0.0}.tgz "$CHARTMUSEUM_API/api/$([ -z $DRONE_TAG ] && echo testing |echo stable)/charts" |
| 157 | + environment: |
| 158 | + CHARTMUSEUM_USERNAME: |
| 159 | + from_secret: chartmuseum_username |
| 160 | + CHARTMUSEUM_PASSWORD: |
| 161 | + from_secret: chartmuseum_password |
| 162 | + CHARTMUSEUM_API: |
| 163 | + from_secret: chartmuseum_api |
| 164 | + |
| 165 | +trigger: |
| 166 | + event: |
| 167 | + - push |
| 168 | + - tag |
0 commit comments