From 51e8d6de6ad18f8d006d19791bce0ab9d7101e19 Mon Sep 17 00:00:00 2001 From: mariadb-RomanNavrotskiy Date: Thu, 23 Jul 2020 18:07:13 +0200 Subject: [PATCH] ci docker image steps --- .drone.jsonnet | 46 +++++++++++++++++++++++++++++++++++++++++++++- Dockerfile.patch | 8 ++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 Dockerfile.patch diff --git a/.drone.jsonnet b/.drone.jsonnet index a0c4b9e53..2c124ff62 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -121,7 +121,7 @@ local Pipeline(branch, platform, event) = { status: ['success', 'failure'], }, }, - regressionlog: { + regressionlog:: { name: 'regressionlog', image: 'docker', volumes: [pipeline._volumes.docker], @@ -137,6 +137,47 @@ local Pipeline(branch, platform, event) = { status: ['success', 'failure'], }, }, + dockerfile:: { + name: 'dockerfile', + image: 'docker:git', + volumes: [pipeline._volumes.docker], + commands: [ + 'git clone --depth 1 https://github.com/mariadb-corporation/mariadb-community-columnstore-docker.git', + 'cd mariadb-community-columnstore-docker', + 'apk add --no-cache patch', + 'patch Dockerfile ../Dockerfile.patch', + 'cp ../result/MariaDB-common-10* ../result/MariaDB-client-10* ../result/MariaDB-server-10* ../result/MariaDB-shared-10* ../result/MariaDB-columnstore-engine-10* ./', + ], + }, + ecr:: { + name: 'ecr', + image: 'plugins/ecr', + settings: { + registry: '866067714787.dkr.ecr.us-east-1.amazonaws.com', + repo: 'columnstore', + create_repository: 'true', + context: 'mariadb-community-columnstore-docker', + access_key: { + from_secret: 'ecr_access_key', + }, + secret_key: { + from_secret: 'ecr_secret_key' + }, + }, + }, + docker:: { + name: 'docker', + image: 'plugins/docker', + settings: { + repo: 'romcheck/columnstore', + context: '/drone/src/mariadb-community-columnstore-docker', + dockerfile: '/drone/src/mariadb-community-columnstore-docker/Dockerfile', + username: 'romcheck', + password: { + from_secret: 'dockerhub_token', + } + }, + }, kind: 'pipeline', type: 'docker', name: std.join(' ', [branch, platform, event]), @@ -229,6 +270,9 @@ local Pipeline(branch, platform, event) = { }, }, ] + + (if (platform == 'centos:8' && event == 'cron') then [pipeline.dockerfile] else []) + + (if (platform == 'centos:8' && event == 'cron') then [pipeline.docker] else []) + + // (if (platform == 'centos:8' && event == 'cron') then [pipeline.ecr] else []) + (if branch == 'develop' then [pipeline.smoke] else []) + (if branch == 'develop' then [pipeline.smokelog] else []) + (if branch == 'develop' then [pipeline.regression] else []) + diff --git a/Dockerfile.patch b/Dockerfile.patch new file mode 100644 index 000000000..558be2e66 --- /dev/null +++ b/Dockerfile.patch @@ -0,0 +1,8 @@ +45,48c45,46 +< # Install MariaDB/ColumnStore packages +< RUN dnf -y install \ +< MariaDB-server \ +< MariaDB-columnstore-engine +--- +> COPY *.rpm / +> RUN dnf -y install /*.rpm && rm -f /*.rpm