Skip to content

Commit

Permalink
Split build/publish docker targets. Build docs from docker image.
Browse files Browse the repository at this point in the history
  • Loading branch information
bcardiff committed Feb 5, 2018
1 parent d5e952f commit 80a1c4a
Showing 1 changed file with 38 additions and 12 deletions.
50 changes: 38 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,38 @@ jobs:
paths:
- build

dist_packages_docs:
dist_docker_build:
machine: true
steps:
- attach_workspace:
at: /tmp/workspace
- run: |
git clone https://github.com/bcardiff/distribution-scripts.git ~/distribution-scripts
cd ~/distribution-scripts
git checkout params
cd docs
make CRYSTAL_VERSION=nightly CRYSTAL_SHA1=$CIRCLE_SHA1 release=true
cd docker
export CRYSTAL_VERSION=nightly
cp /tmp/workspace/build/crystal_${CRYSTAL_VERSION}-1_amd64.deb crystal.deb
make CRYSTAL_VERSION=${CRYSTAL_VERSION} CRYSTAL_DEB=crystal.deb
- persist_to_workspace:
root: ../distribution-scripts/docs/
root: ../distribution-scripts/docker/
paths:
- build

dist_docker:
dist_docker_publish:
machine: true
steps:
- attach_workspace:
at: /tmp/workspace
- run: |
export CRYSTAL_VERSION=nightly
gunzip -c /tmp/workspace/build/docker-${CRYSTAL_VERSION}.tar.gz | docker image load
gunzip -c /tmp/workspace/build/docker-${CRYSTAL_VERSION}-build.tar.gz | docker image load
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
docker push crystallang/crystal:${CRYSTAL_VERSION}
docker push crystallang/crystal:${CRYSTAL_VERSION}-build
dist_packages_docs:
machine: true
steps:
- attach_workspace:
Expand All @@ -106,12 +123,15 @@ jobs:
git clone https://github.com/bcardiff/distribution-scripts.git ~/distribution-scripts
cd ~/distribution-scripts
git checkout params
cd docker
cd docs
export CRYSTAL_VERSION=nightly
cp /tmp/workspace/build/crystal_${CRYSTAL_VERSION}-1_amd64.deb crystal.deb
docker build -t crystallang/crystal:nightly --build-arg crystal_deb=crystal.deb .
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
docker push crystallang/crystal:nightly
gunzip -c /tmp/workspace/build/docker-${CRYSTAL_VERSION}-build.tar.gz | docker image load
make CRYSTAL_VERSION=${CRYSTAL_VERSION} CRYSTAL_SHA1=$CIRCLE_SHA1 CRYSTAL_DOCKER_IMAGE=crystallang/crystal:${CRYSTAL_VERSION}-build
- persist_to_workspace:
root: ../distribution-scripts/docs/
paths:
- build

dist_packages_collect:
docker:
Expand Down Expand Up @@ -149,14 +169,20 @@ workflows:
filters: *nightly_filter
- dist_packages_docs:
filters: *nightly_filter
- dist_docker:
requires:
- dist_docker_build
- dist_docker_build:
filters: *nightly_filter
requires:
- dist_packages_linux
- dist_docker_publish:
filters: *nightly_filter
requires:
- dist_docker_build
- dist_packages_collect:
filters: *nightly_filter
requires:
- dist_packages_linux
- dist_packages_darwin
- dist_docker_build
- dist_packages_docs

0 comments on commit 80a1c4a

Please sign in to comment.