Skip to content

Commit

Permalink
circleci new apicast policies
Browse files Browse the repository at this point in the history
  • Loading branch information
mikz committed Feb 15, 2018
1 parent 094db88 commit bcdf4bb
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 5 deletions.
60 changes: 56 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
version: 2
jobs:
build:
deploy:
docker:
- image: quay.io/3scale/s2i:v1.1.5-ce
- image: quay.io/3scale/s2i:v1.1.8-ce
environment:
APICAST_VERSION: master
environment:
REGISTRY: "${DOCKER_REGISTRY}/3scale"
DOCKER_REGISTRY: "quay.io"
working_directory: /root/apicast-cloud
steps:
- checkout
Expand All @@ -16,11 +18,61 @@ jobs:
name: Push docker image
command: |
if [ -n "${CIRCLE_TAG}" ] || [ -n "${CIRCLE_BRANCH}" ]; then
docker login -u="${DOCKER_USER}" -p="${DOCKER_PASS}" "${DOCKER_REGISTRY}"
docker login -u="${DOCKER_USERNAME}" --password-stdin "${DOCKER_REGISTRY}" <<< "${DOCKER_PASSWORD}"
(cd apicast && make push REMOTE_IMAGE_NAME=apicast-cloud-hosted:apicast-${CIRCLE_TAG:-${CIRCLE_BRANCH}})
(cd mapping-service && make push IMAGE_TAG=${CIRCLE_TAG:-${CIRCLE_BRANCH}})
fi
apicast-test:
docker:
- image: quay.io/3scale/s2i-openresty-centos7:1.13.6.1-rover5
environment:
TEST_NGINX_BINARY: openresty
LUA_BIN_PATH: /opt/app-root/bin
working_directory: /opt/app-root/apicast-cloud-hosted
steps:
- checkout
- restore_cache:
keys:
- apicast-cloud-hosted-rover-{{ arch }}-{{ checksum "apicast/Roverfile.lock" }}
- apicast-cloud-hosted-rover-{{ arch }}-{{ .Branch }}
- apicast-cloud-hosted-rover-{{ arch }}-master
- run: cd apicast && rover install
- save_cache:
key: apicast-cloud-hosted-rover-{{ arch }}-{{ checksum "apicast/Roverfile.lock" }}
paths:
- apicast/lua_modules
- restore_cache:
keys:
- apicast-cloud-hosted-cpanm-{{ arch }}-{{ checksum "apicast/cpanfile" }}
- apicast-cloud-hosted-cpanm-{{ arch }}-{{ .Branch }}
- apicast-cloud-hosted-{{ arch }}-master
- run: /usr/libexec/s2i/entrypoint cpanm --notest --installdeps ./apicast
- save_cache:
key: apicast-cloud-hosted-cpanm-{{ arch }}-{{ checksum "apicast/cpanfile" }}
paths:
- ~/perl5
- run: mkdir -p apicast/tmp/junit
- run:
command: cd apicast && /usr/libexec/s2i/entrypoint sh -c 'rover exec prove --harness=TAP::Harness::JUnit $(circleci tests glob "t/**/*.t" | circleci tests split --split-by=timings --timings-type=filename)'
environment:
JUNIT_OUTPUT_FILE: tmp/junit/prove.xml
TEST_NGINX_ERROR_LOG: tmp/prove.log
- store_artifacts:
path: apicast/tmp
destination: tmp
- store_test_results:
path: apicast/tmp/junit
workflows:
version: 2
build_and_test:
jobs:
- apicast-test
- deploy:
context: org-global
requires:
- apicast-test

# TODO: remove this once CircleCI 2.0 supports building from tags
# https://discuss.circleci.com/t/git-tag-deploys-in-2-0/9493/5
deployment:
Expand Down
1 change: 0 additions & 1 deletion apicast/t/blacklist.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ GET /t HTTP/1.1
=== TEST 2: balancer upstream blacklist
Going to prevent connecting to local upstream.
--- ONLY
--- configuration
{
"services": [
Expand Down

0 comments on commit bcdf4bb

Please sign in to comment.