Verified Commit bcec2713 authored by Mike Barkmin's avatar Mike Barkmin 🕶
Browse files

ci: use build-and-relase template

parent c666f955
Pipeline #247177378 passed with stages
in 10 minutes and 28 seconds
......@@ -9,32 +9,13 @@ before_script:
stages:
- build
- test
- tag
- release
- deploy
build:
stage: build
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
except:
- master
- tags
build-tags:
stage: build
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
only:
- tags
build-master:
stage: build
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE"
only:
- master
include:
- project: 'openpatch/gitlab-ci-pipeline'
file: 'build-and-release.yml'
test:
stage: test
......@@ -46,41 +27,8 @@ test:
-e OPENPATCH_HMAC_SECRET='s3cr3t'
-e OPENPATCH_BASICAUTH_SECRET='s3cr3t'
--net openpatch-runner-net
"$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
"$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
python3 -m unittest -f -v tests/api_v1.py
except:
- master
- tags
test-tags:
stage: test
script:
- docker pull registry.gitlab.com/openpatch/runner-java
- docker network create openpatch-runner-net
- docker run
-v /var/run/docker.sock:/var/run/docker.sock
-e OPENPATCH_HMAC_SECRET='s3cr3t'
-e OPENPATCH_BASICAUTH_SECRET='s3cr3t'
--net openpatch-runner-net
"$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
python3 -m unittest -f -v tests/api_v1.py
only:
- tags
test-master:
stage: test
script:
- docker pull registry.gitlab.com/openpatch/runner-java
- docker network create openpatch-runner-net
- docker run
-v /var/run/docker.sock:/var/run/docker.sock
-e OPENPATCH_HMAC_SECRET='s3cr3t'
-e OPENPATCH_BASICAUTH_SECRET='s3cr3t'
--net openpatch-runner-net
"$CI_REGISTRY_IMAGE"
python3 -m unittest -f -v tests/api_v1.py
only:
- master
pages:
stage: deploy
......
......@@ -7,14 +7,14 @@
- OPENPATCH_CPU_PERIOD: Specify the CPU CFS scheduler period, which is used alongside OPENPATCH_CPU_QUOTA. Defaults to 100 micro-seconds.
- OPENPATCH_CPU_QUOTA: Impose a CPU CFS quota on the container. The number of microseconds per OPENPATCH_CPU_QUOTA that the container is limited to before throttled.
- OPENPATCH_CPU_SHARES: Set this flag to a value greater or less than the default of 1024 to increase or reduce the container’s weight, and give it access to a greater or lesser proportion of the host machine’s CPU cycles.
- OPENPATCH_PROCESSES: How many uswgi process will be spawn. This controll how many concrete runners will run simultaneously. Defaults to 5
- OPENPATCH_PROCESSES: How many uswgi process will be spawned. This controll how many concrete runners will run simultaneously. Defaults to 5
- SENTRY_DSN: Used for error tracking
# Testing
```
docker run -v /var/run/docker.sock:/var/run/docker.sock --net openpatch-runner-net openpatch-runner python3 -m unittest -f -v tests/api_v1.py
docker pull registry.gitlab.com/openpatch/runner-java:v1.0.0
docker-compose run runner python3 -m unittest -f -v tests/api_v1.py
```
# Built With
......
version: '3'
version: "3"
services:
runner:
......@@ -7,7 +7,8 @@ services:
- 5011:80
environment:
- OPENPATCH_BASICAUTH_SECRET=s3cr3t
- OPEOPENPATCHH_ENV=development
- OPENPATCH_ENV=development
- OPENPATCH_HMAC_SECRET=not-secret
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- .:/var/www/app
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment