-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
2cb5312
commit c852fea
Showing
1 changed file
with
249 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,302 +1,314 @@ | ||
--- | ||
kind: pipeline | ||
name: default | ||
|
||
volumes: | ||
platform: | ||
os: linux | ||
arch: amd64 | ||
|
||
clone: | ||
disable: true | ||
|
||
steps: | ||
- name: git-clone | ||
image: public.ecr.aws/prima/drone-git:1.3-3 | ||
environment: | ||
PLUGIN_DEPTH: 5 | ||
|
||
- name: cache-restore | ||
image: public.ecr.aws/prima/drone-tools:1.22.1 | ||
commands: | ||
- . /etc/profile.d/ecs-credentials-endpoint | ||
- cache-restore | ||
environment: | ||
BUCKET_NAME: prima-ci-cache | ||
CACHE_COMPRESSION_ALGO: gz | ||
volumes: | ||
- name: ecs | ||
path: /etc/profile.d/ecs-credentials-endpoint | ||
- name: docker | ||
path: /var/run/docker.sock | ||
depends_on: | ||
- git-clone | ||
|
||
- name: check-secrets | ||
image: public.ecr.aws/prima/drone-tools:1.22.1 | ||
commands: | ||
- . /etc/profile.d/ecs-credentials-endpoint | ||
- check-secrets-grants | ||
volumes: | ||
- name: ecs | ||
path: /etc/profile.d/ecs-credentials-endpoint | ||
depends_on: | ||
- git-clone | ||
|
||
- name: check-public-docker-images | ||
image: public.ecr.aws/prima/drone-tools:1.22.1 | ||
commands: | ||
- check-public-docker-images | ||
depends_on: | ||
- git-clone | ||
|
||
- name: build-image | ||
image: public.ecr.aws/prima/drone-tools:1.22.1 | ||
commands: | ||
- sed -i 's/USER app/USER root/g' ./Dockerfile | ||
- docker build -t prima/event_sourcing.rs-ci:${DRONE_COMMIT} ./ | ||
environment: | ||
DOCKER_DEFAULT_PLATFORM: linux/amd64 | ||
volumes: | ||
- name: docker | ||
host: | ||
path: /var/run/docker.sock | ||
path: /var/run/docker.sock | ||
depends_on: | ||
- cache-restore | ||
|
||
- name: cargo-deps | ||
image: prima/event_sourcing.rs-ci:${DRONE_COMMIT} | ||
commands: | ||
- cargo fetch | ||
environment: | ||
CARGO_HOME: /drone/src/.cargo | ||
depends_on: | ||
- build-image | ||
|
||
- name: cargo-format | ||
image: prima/event_sourcing.rs-ci:${DRONE_COMMIT} | ||
commands: | ||
- cargo make --profile drone format-ci | ||
environment: | ||
CARGO_HOME: /drone/src/.cargo | ||
depends_on: | ||
- cargo-deps | ||
|
||
- name: cargo-clippy-ci | ||
image: prima/event_sourcing.rs-ci:${DRONE_COMMIT} | ||
commands: | ||
- cargo make --profile drone clippy-ci | ||
environment: | ||
BUILD_ENV: dev | ||
CARGO_HOME: /drone/src/.cargo | ||
depends_on: | ||
- cargo-format | ||
|
||
- name: cargo-test | ||
image: prima/event_sourcing.rs-ci:${DRONE_COMMIT} | ||
commands: | ||
- cargo make --profile drone test | ||
environment: | ||
BUILD_ENV: dev | ||
CARGO_HOME: /drone/src/.cargo | ||
depends_on: | ||
- cargo-clippy-ci | ||
|
||
- name: cargo-build | ||
image: prima/event_sourcing.rs-ci:${DRONE_COMMIT} | ||
commands: | ||
- cargo make --profile drone build-ci | ||
environment: | ||
BUILD_ENV: dev | ||
CARGO_HOME: /drone/src/.cargo | ||
when: | ||
branch: | ||
exclude: | ||
- master | ||
depends_on: | ||
- cargo-test | ||
|
||
- name: cache-cleanup | ||
image: prima/event_sourcing.rs-ci:${DRONE_COMMIT} | ||
commands: | ||
- cargo make --profile drone cache-cleanup | ||
when: | ||
branch: | ||
- master | ||
depends_on: | ||
- cargo-build | ||
- cargo-format | ||
- cargo-clippy-ci | ||
- cargo-test | ||
|
||
- name: cache-save | ||
image: public.ecr.aws/prima/drone-tools:1.22.1 | ||
commands: | ||
- . /etc/profile.d/ecs-credentials-endpoint | ||
- cache-save .cargo | ||
environment: | ||
BUCKET_NAME: prima-ci-cache | ||
CACHE_COMPRESSION_ALGO: gz | ||
volumes: | ||
- name: ecs | ||
host: | ||
path: /etc/profile.d/ecs-credentials-endpoint | ||
path: /etc/profile.d/ecs-credentials-endpoint | ||
- name: docker | ||
path: /var/run/docker.sock | ||
when: | ||
branch: | ||
- master | ||
depends_on: | ||
- cache-cleanup | ||
|
||
services: | ||
- environment: | ||
- name: postgres | ||
image: public.ecr.aws/bitnami/postgresql:11 | ||
environment: | ||
POSTGRES_DB: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_USER: postgres | ||
image: public.ecr.aws/bitnami/postgresql:11 | ||
name: postgres | ||
- environment: | ||
|
||
- name: rabbit | ||
image: public.ecr.aws/bitnami/rabbitmq:3.8 | ||
environment: | ||
RABBITMQ_PASSWORD: rabbit | ||
RABBITMQ_USERNAME: rabbit | ||
RABBITMQ_VHOST: rabbit | ||
image: public.ecr.aws/bitnami/rabbitmq:3.8 | ||
name: rabbit | ||
- environment: | ||
|
||
- name: zookeeper | ||
image: public.ecr.aws/prima/zookeeper:7.2.2 | ||
environment: | ||
ZOOKEEPER_CLIENT_PORT: 2181 | ||
ZOOKEEPER_TICK_TIME: 2000 | ||
image: public.ecr.aws/prima/zookeeper:7.2.2 | ||
name: zookeeper | ||
ports: | ||
- 2181 | ||
- environment: | ||
|
||
- name: kafka | ||
image: public.ecr.aws/prima/kafka:7.2.2 | ||
environment: | ||
JMX_PORT: 9997 | ||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT_HOST://host.docker.internal:29092, PLAINTEXT://kafka:9092 | ||
KAFKA_BROKER_ID: 1 | ||
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT | ||
KAFKA_JMX_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false | ||
-Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=kafka -Dcom.sun.management.jmxremote.rmi.port=9997 | ||
KAFKA_JMX_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=kafka -Dcom.sun.management.jmxremote.rmi.port=9997 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | ||
image: public.ecr.aws/prima/kafka:7.2.2 | ||
name: kafka | ||
ports: | ||
- 9092 | ||
- 9997 | ||
- 29092 | ||
|
||
|
||
|
||
clone: | ||
disable: true | ||
|
||
steps: | ||
- name: git-clone | ||
image: public.ecr.aws/prima/drone-git:1.3-3 | ||
environment: | ||
PLUGIN_DEPTH: "5" | ||
|
||
- name: cache-restore | ||
image: public.ecr.aws/prima/drone-tools:1.22.1 | ||
environment: | ||
BUCKET_NAME: "prima-ci-cache" | ||
CACHE_COMPRESSION_ALGO: "gz" | ||
volumes: | ||
- name: ecs | ||
path: /etc/profile.d/ecs-credentials-endpoint | ||
- name: docker | ||
path: /var/run/docker.sock | ||
commands: | ||
- . /etc/profile.d/ecs-credentials-endpoint | ||
- cache-restore | ||
depends_on: | ||
- git-clone | ||
- name: check-secrets | ||
image: public.ecr.aws/prima/drone-tools:1.22.1 | ||
volumes: | ||
- name: ecs | ||
path: /etc/profile.d/ecs-credentials-endpoint | ||
commands: | ||
- . /etc/profile.d/ecs-credentials-endpoint | ||
- check-secrets-grants | ||
depends_on: | ||
- git-clone | ||
|
||
- name: check-public-docker-images | ||
image: public.ecr.aws/prima/drone-tools:1.22.1 | ||
commands: | ||
- check-public-docker-images | ||
depends_on: | ||
- git-clone | ||
|
||
|
||
|
||
- name: build-image | ||
image: public.ecr.aws/prima/drone-tools:1.22.1 | ||
volumes: | ||
- name: docker | ||
path: /var/run/docker.sock | ||
commands: | ||
- sed -i 's/USER app/USER root/g' ./Dockerfile | ||
- docker build -t prima/event_sourcing.rs-ci:${DRONE_COMMIT} ./ | ||
environment: | ||
DOCKER_DEFAULT_PLATFORM: linux/amd64 | ||
depends_on: | ||
- cache-restore | ||
- name: cargo-deps | ||
image: prima/event_sourcing.rs-ci:${DRONE_COMMIT} | ||
environment: | ||
CARGO_HOME: /drone/src/.cargo | ||
commands: | ||
- cargo fetch | ||
depends_on: | ||
- build-image | ||
|
||
- name: cargo-format | ||
image: prima/event_sourcing.rs-ci:${DRONE_COMMIT} | ||
environment: | ||
CARGO_HOME: /drone/src/.cargo | ||
commands: | ||
- cargo make --profile drone format-ci | ||
depends_on: | ||
- cargo-deps | ||
|
||
- name: cargo-clippy-ci | ||
image: prima/event_sourcing.rs-ci:${DRONE_COMMIT} | ||
environment: | ||
CARGO_HOME: /drone/src/.cargo | ||
BUILD_ENV: dev | ||
commands: | ||
- cargo make --profile drone clippy-ci | ||
depends_on: | ||
- cargo-format | ||
|
||
- name: cargo-test | ||
image: prima/event_sourcing.rs-ci:${DRONE_COMMIT} | ||
environment: | ||
{"CARGO_HOME": "/drone/src/.cargo", "CARGO_HTTP_CAINFO": "", "BUILD_ENV": "dev"} | ||
commands: | ||
- cargo make --profile drone test | ||
depends_on: | ||
- cargo-clippy-ci | ||
|
||
- name: cargo-build | ||
image: prima/event_sourcing.rs-ci:${DRONE_COMMIT} | ||
environment: | ||
CARGO_HOME: /drone/src/.cargo | ||
BUILD_ENV: dev | ||
commands: | ||
- cargo make --profile drone build-ci | ||
depends_on: | ||
- cargo-test | ||
when: | ||
branch: | ||
exclude: | ||
- master | ||
|
||
|
||
- name: cache-cleanup | ||
image: prima/event_sourcing.rs-ci:${DRONE_COMMIT} | ||
commands: | ||
- cargo make --profile drone cache-cleanup | ||
when: | ||
branch: master | ||
depends_on: | ||
|
||
- cargo-build | ||
|
||
- cargo-format | ||
- cargo-clippy-ci | ||
- cargo-test | ||
|
||
|
||
- name: cache-save | ||
image: public.ecr.aws/prima/drone-tools:1.22.1 | ||
environment: | ||
BUCKET_NAME: "prima-ci-cache" | ||
CACHE_COMPRESSION_ALGO: "gz" | ||
volumes: | ||
- name: ecs | ||
path: /etc/profile.d/ecs-credentials-endpoint | ||
- name: docker | ||
path: /var/run/docker.sock | ||
commands: | ||
- . /etc/profile.d/ecs-credentials-endpoint | ||
- cache-save .cargo | ||
when: | ||
branch: master | ||
depends_on: | ||
- cache-cleanup | ||
volumes: | ||
- name: docker | ||
host: | ||
path: /var/run/docker.sock | ||
- name: ecs | ||
host: | ||
path: /etc/profile.d/ecs-credentials-endpoint | ||
|
||
trigger: | ||
event: | ||
- push | ||
|
||
- push | ||
|
||
--- | ||
kind: pipeline | ||
name: build-production | ||
|
||
|
||
volumes: | ||
- name: docker | ||
host: | ||
path: /var/run/docker.sock | ||
- name: ecs | ||
host: | ||
path: /etc/profile.d/ecs-credentials-endpoint | ||
platform: | ||
os: linux | ||
arch: amd64 | ||
|
||
clone: | ||
disable: true | ||
|
||
steps: | ||
- name: git-clone | ||
image: public.ecr.aws/prima/drone-git:1.3-3 | ||
environment: | ||
PLUGIN_DEPTH: "5" | ||
|
||
- name: cache-restore | ||
image: public.ecr.aws/prima/drone-tools:1.22.1 | ||
environment: | ||
BUCKET_NAME: "prima-ci-cache" | ||
CACHE_COMPRESSION_ALGO: "gz" | ||
volumes: | ||
- name: ecs | ||
path: /etc/profile.d/ecs-credentials-endpoint | ||
- name: docker | ||
path: /var/run/docker.sock | ||
commands: | ||
- . /etc/profile.d/ecs-credentials-endpoint | ||
- cache-restore | ||
depends_on: | ||
- git-clone | ||
|
||
- name: build-image | ||
image: public.ecr.aws/prima/drone-tools:1.22.1 | ||
volumes: | ||
- name: docker | ||
path: /var/run/docker.sock | ||
commands: | ||
- sed -i 's/USER app/USER root/g' ./Dockerfile | ||
- docker build -t prima/event_sourcing.rs-ci:${DRONE_COMMIT} ./ | ||
environment: | ||
DOCKER_DEFAULT_PLATFORM: linux/amd64 | ||
depends_on: | ||
- cache-restore | ||
|
||
- name: build-production | ||
image: prima/event_sourcing.rs-ci:${DRONE_COMMIT} | ||
environment: | ||
{'CARGO_AUTH_KEY': {'from_secret': 'cargo_auth_key'}} | ||
volumes: | ||
- name: ecs | ||
path: /etc/profile.d/ecs-credentials-endpoint | ||
commands: | ||
- . /etc/profile.d/ecs-credentials-endpoint | ||
- ./deploy/build production | ||
depends_on: | ||
- build-image | ||
|
||
|
||
|
||
- name: git-clone | ||
image: public.ecr.aws/prima/drone-git:1.3-3 | ||
environment: | ||
PLUGIN_DEPTH: 5 | ||
|
||
- name: cache-restore | ||
image: public.ecr.aws/prima/drone-tools:1.22.1 | ||
commands: | ||
- . /etc/profile.d/ecs-credentials-endpoint | ||
- cache-restore | ||
environment: | ||
BUCKET_NAME: prima-ci-cache | ||
CACHE_COMPRESSION_ALGO: gz | ||
volumes: | ||
- name: ecs | ||
path: /etc/profile.d/ecs-credentials-endpoint | ||
- name: docker | ||
path: /var/run/docker.sock | ||
depends_on: | ||
- git-clone | ||
|
||
- name: build-image | ||
image: public.ecr.aws/prima/drone-tools:1.22.1 | ||
commands: | ||
- sed -i 's/USER app/USER root/g' ./Dockerfile | ||
- docker build -t prima/event_sourcing.rs-ci:${DRONE_COMMIT} ./ | ||
environment: | ||
DOCKER_DEFAULT_PLATFORM: linux/amd64 | ||
volumes: | ||
- name: docker | ||
path: /var/run/docker.sock | ||
depends_on: | ||
- cache-restore | ||
|
||
- name: build-production | ||
image: prima/event_sourcing.rs-ci:${DRONE_COMMIT} | ||
commands: | ||
- . /etc/profile.d/ecs-credentials-endpoint | ||
- ./deploy/build production | ||
environment: | ||
CARGO_AUTH_KEY: | ||
from_secret: cargo_auth_key | ||
volumes: | ||
- name: ecs | ||
path: /etc/profile.d/ecs-credentials-endpoint | ||
depends_on: | ||
- build-image | ||
|
||
volumes: | ||
- name: docker | ||
host: | ||
path: /var/run/docker.sock | ||
- name: ecs | ||
host: | ||
path: /etc/profile.d/ecs-credentials-endpoint | ||
|
||
trigger: | ||
{'event': 'tag', 'ref': ['refs/tags/*.*.*']} | ||
|
||
|
||
event: | ||
- tag | ||
ref: | ||
- refs/tags/*.*.* | ||
|
||
--- | ||
kind: pipeline | ||
name: email-failure | ||
|
||
platform: | ||
os: linux | ||
arch: amd64 | ||
|
||
clone: | ||
disable: true | ||
|
||
steps: | ||
- name: email-failure | ||
image: public.ecr.aws/prima/drone-email | ||
environment: | ||
PLUGIN_USERNAME: | ||
from_secret: email_username | ||
PLUGIN_PASSWORD: | ||
from_secret: email_password | ||
settings: | ||
host: email-smtp.eu-west-1.amazonaws.com | ||
from: drone@prima.it | ||
- name: email-failure | ||
image: public.ecr.aws/prima/drone-email | ||
settings: | ||
from: drone@prima.it | ||
host: email-smtp.eu-west-1.amazonaws.com | ||
environment: | ||
PLUGIN_PASSWORD: | ||
from_secret: email_password | ||
PLUGIN_USERNAME: | ||
from_secret: email_username | ||
|
||
trigger: | ||
status: | ||
- failure | ||
- failure | ||
target: | ||
exclude: | ||
- qa-stack | ||
- qa-it | ||
- qa | ||
- qa-stack | ||
- qa-it | ||
- qa | ||
|
||
depends_on: | ||
- default | ||
- build-production | ||
|
||
--- | ||
kind: signature | ||
hmac: 54b252cccd203bf13c9c20e7b428b83ca0be143a5036872450e6b0fa12f2ddac | ||
|
||
... |