Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
86 lines (81 sloc) 2.53 KB
# yamllint disable rule:line-length
version: 2.0
jobs:
build:
docker:
- image: fpco/stack-build:lts-13.3
environment:
GIT_AUTHOR_EMAIL: ci@restyled.io
GIT_AUTHOR_NAME: Restyled.io CI
GIT_COMMITTER_EMAIL: ci@restyled.io
GIT_COMMITTER_NAME: Restyled.io CI
STACK_ARGUMENTS: --no-terminal
- image: circleci/postgres:9.6.5-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: restyled_test
- image: redis:4.0.2-alpine
steps:
- checkout
- run:
name: Digest
command: git ls-files | xargs md5sum > digest
- restore_cache:
keys:
- v2-{{ .Branch }}-{{ checksum "stack.yaml" }}-{{ checksum "digest" }}
- v2-{{ .Branch }}-{{ checksum "stack.yaml" }}-
- v2-{{ .Branch }}
- v2-
- run:
name: Dependencies
command: |
make setup setup.lint
curl "$HLINT_YAML_SRC" > .hlint.yaml
environment:
HLINT_YAML_SRC: https://raw.githubusercontent.com/pbrisbin/dotfiles/master/hlint.yaml
- run:
name: Build
command: make build
- save_cache:
key: v2-{{ .Branch }}-{{ checksum "stack.yaml" }}-{{ checksum "digest" }}
paths:
- ~/.stack
- ./.stack-work
- run:
name: Migrate
command: db/migrate test upgrade
- run:
name: Test
command: make test
- run:
name: Lint
command: make lint
- run:
name: Tag Master Build
command: |
if [ "$CIRCLE_BRANCH" = master ]; then
git tag -a -m "b$CIRCLE_BUILD_NUM" "b$CIRCLE_BUILD_NUM"
git push --tags
fi
# Triggered manually via API to deploy image built in Quay
deploy:
docker:
- image: quay.io/restyled-io/ops
steps:
- setup_remote_docker
- run:
name: Deploy
command: |
cat >Dockerfile.web <<EOM
FROM $DEPLOY_IMAGE:$DEPLOY_TAG
CMD ["/app/restyled.io"]
EOM
cat >Dockerfile.backend <<EOM
FROM $DEPLOY_IMAGE:$DEPLOY_TAG
CMD ["/app/restyled.io-backend"]
EOM
heroku container:login
heroku container:push --recursive --app restyled-io
heroku container:release web backend --app restyled-io
notify "restyled-io" "Deploy of $DEPLOY_TAG successful"
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.