2020-10-03 21:19:13 +02:00
|
|
|
image: docker:stable
|
|
|
|
|
|
|
|
variables:
|
|
|
|
DOCKER_TLS_CERTDIR: "/certs"
|
|
|
|
|
|
|
|
services:
|
|
|
|
- docker:19.03.8-dind
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- docker info
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- build
|
2021-01-17 00:42:22 +01:00
|
|
|
- test
|
2020-10-03 21:19:13 +02:00
|
|
|
- create-release-package
|
2021-01-17 00:45:07 +01:00
|
|
|
- upload-release
|
2020-10-03 21:19:13 +02:00
|
|
|
|
|
|
|
build:
|
|
|
|
stage: build
|
|
|
|
before_script:
|
|
|
|
- apk update && apk add make > /dev/null
|
|
|
|
script:
|
|
|
|
- make build-docker
|
|
|
|
artifacts:
|
|
|
|
name: "$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME"
|
|
|
|
paths:
|
|
|
|
- build
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- master
|
|
|
|
|
2021-01-17 00:42:22 +01:00
|
|
|
test:
|
|
|
|
stage: test
|
|
|
|
dependencies:
|
|
|
|
- build
|
|
|
|
before_script:
|
|
|
|
- apk update && apk add make > /dev/null
|
|
|
|
script:
|
|
|
|
- make test-docker
|
|
|
|
artifacts:
|
|
|
|
name: "$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME"
|
|
|
|
paths:
|
|
|
|
- build
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- master
|
|
|
|
|
2020-10-03 21:19:13 +02:00
|
|
|
create-release-package:
|
|
|
|
stage: create-release-package
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
|
|
|
dependencies:
|
2021-01-17 00:42:22 +01:00
|
|
|
- test
|
2020-10-03 21:19:13 +02:00
|
|
|
before_script:
|
|
|
|
- apk update && apk add zip > /dev/null
|
|
|
|
script:
|
|
|
|
- mv build/docker/pumptools-public.zip ./pumptools.zip
|
|
|
|
- rm -r build
|
|
|
|
- find . -mindepth 1 ! -regex '^./pumptools.zip' -delete
|
|
|
|
- unzip pumptools.zip
|
|
|
|
- rm pumptools.zip
|
|
|
|
artifacts:
|
|
|
|
name: "$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME"
|
|
|
|
paths:
|
|
|
|
- ./*
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- master
|
2021-01-17 00:45:07 +01:00
|
|
|
|
|
|
|
upload-release:
|
|
|
|
stage: upload-release
|
|
|
|
dependencies:
|
|
|
|
- create-release-package
|
2020-10-03 21:19:13 +02:00
|
|
|
before_script:
|
|
|
|
- apk update && apk add curl > /dev/null
|
|
|
|
script:
|
2021-01-17 00:45:07 +01:00
|
|
|
- echo "Uploading ${CI_PROJECT_NAME}-${CI_COMMIT_TAG}..."
|
|
|
|
- curl --silent --show-error -F "key=${CI_UPLOAD_KEY}" -F "filename=${CI_PROJECT_NAME}-v${CI_COMMIT_TAG}.zip" -F "file=@./pumptools.zip" ${CI_UPLOAD_URL}
|
2020-10-03 21:19:13 +02:00
|
|
|
only:
|
|
|
|
- tags
|