monolithic/.circleci/config.yml
James Kinsman f013ac0958
Change maps to allow user agent mapping too (#87)
Correclty disable StrictHostKeyChecking whilst we are at it!
map "$http_useragent---$http_host" $cacheidentifier {
Hostnames in maps file need to be regexs
Save the docker image into the artifacts store to allow download for testing
Need to handle *. wildcard
Use # instead of / as regex/sed seperator to provide a slightly cleaner sed line for debug
Provide comments and breakdown for sed (Requested by @GotenXiao
Changed UA/Host seperator from --- to £££ @rconan suggestion from UKLans chat

Closes #86 See github for details
2020-02-11 15:32:09 +00:00

74 lines
2.3 KiB
YAML

workflows:
version: 2
build_test_deploy:
jobs:
- test
- publish_latest:
context: docker-hub
requires:
- test
filters:
branches:
only:
- master
version: 2
jobs:
test:
docker:
- image: circleci/python:2-jessie
steps:
- checkout
- setup_remote_docker: # (2)
docker_layer_caching: false # (3)
- run:
name: Install goss
command: |
# rather than give internet scripts SU rights, we install to local user bin and add to path
mkdir ~/bin
export GOSS_DST=~/bin
export PATH=$PATH:~/bin
curl -fsSL https://goss.rocks/install | sh
goss -version
- run:
name: Test
command: |
# Don't forget path!
export PATH=$PATH:~/bin
# Important, change from mount to work on remote docker, see https://github.com/aelsabbahy/goss/pull/271
# If using machine image you do not need this.
export GOSS_FILES_STRATEGY=cp
./run-tests.sh circleci keepimage
- run:
name: Save docker image
command: |
mkdir -p workspace
docker save -o workspace/lancachenet-monolithic.tar lancachenet/monolithic:goss-test
- persist_to_workspace:
root: workspace
paths:
lancachenet-monolithic.tar
- store_test_results:
path: reports
- store_artifacts:
path: reports
destination: reports
- store_artifacts:
path: workspace/lancachenet-monolithic.tar
destination: docker-lancachenet-monolithic.tar
publish_latest:
docker:
- image: circleci/python:2-jessie
steps:
- setup_remote_docker: # (2)
docker_layer_caching: false # (3)
- attach_workspace:
at: /tmp/workspace
- run:
name: "Deploy latest to docker hub"
command: |
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker load -i /tmp/workspace/lancachenet-monolithic.tar
docker tag lancachenet/monolithic:goss-test lancachenet/monolithic:latest
docker push lancachenet/monolithic:latest