Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Elixirのビルド・デプロイ
machine:
timezone:
Asia/Tokyo
services:
- docker
node:
version: 5.1.0
dependencies:
cache_directories:
- ~/docker
override:
- cp ~/.ssh/id_circleci_github ci/docker/github.pem
- if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; else cd ci/docker && docker build -t trusty .; fi
- if [[ ! -e ~/docker/image.tar ]]; then mkdir -p ~/docker; docker save trusty > ~/docker/image.tar; fi
- cd deploy && bundle install
test:
override:
- docker run -v `pwd`:/build -v /etc/localtime:/etc/localtime:ro -i -t trusty /bin/sh -c 'service postgresql start && cd /build && ./ci/test.sh'
deployment:
master:
branch: master
commands:
- ./ci/deploy-to-staging.sh # ensure that the latest version is running in staging
- ./ci/get-prev-rel.sh
- docker run -v `pwd`:/build -v /etc/localtime:/etc/localtime:ro -i -t trusty /bin/sh -c 'cd /build && ./ci/build-release.sh'
- |
PACKAGE="./rel/example_app/releases/`cat VERSION`/example_app.tar.gz"
DEST="s3://example-app-packages"
aws s3 cp "${PACKAGE}" "${DEST}/`cat VERSION`.tar.gz"
aws s3 cp "${PACKAGE}" "${DEST}/latest.tar.gz"
aws s3 cp ./VERSION "${DEST}/VERSION"
- ./ci/deploy-to-staging.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment