Skip to content

Commit

Permalink
Get deploy step to work
Browse files Browse the repository at this point in the history
Simplify deploy shell scripts;
Run yarn bundle as part of client-build step;
Install awscli as part of deploy step;
Don't run ui-upload in another container.
  • Loading branch information
bboreham committed Aug 30, 2018
1 parent 7b9a15e commit 1734def
Showing 1 changed file with 19 additions and 27 deletions.
46 changes: 19 additions & 27 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,16 @@ jobs:
steps:
- checkout
# Convoluted set of steps here to mimic Makefile actions of bind-mounting different dirs into container
- run: |
mv client/app /home/weave/
cd /home/weave; mkdir build ; yarn run build ; mv build scope/client
cd /home/weave; mkdir build-external; yarn run build-external; mv build-external scope/client
- run: mv client/app /home/weave/
- run: cd /home/weave; mkdir build ; yarn run build ; mv build scope/client
- run: cd /home/weave; mkdir build-external; yarn run build-external; mv build-external scope/client
- run: cd /home/weave; mkdir tmp ; yarn run bundle ; mv tmp scope
- persist_to_workspace:
root: /home/weave/scope
paths:
- client/build/
- client/build-external/
- tmp/weave-scope.tgz

client-test:
<<: *client-defaults
Expand Down Expand Up @@ -126,7 +127,6 @@ jobs:
- run: |
sudo apt-get update
sudo apt-get install python-pip jq pv
sudo pip install awscli
- run: mkdir $CIRCLE_ARTIFACTS
# kick off creation of test VMs
- run: test -z "$SECRET_PASSWORD" || bin/setup-circleci-secrets "$SECRET_PASSWORD"
Expand Down Expand Up @@ -157,30 +157,22 @@ jobs:
- setup_remote_docker
- attach_workspace:
at: .
# PATH must be set here as circle currently does not support string interpolation
# for environment
# https://discuss.circleci.com/t/bin-sh-mkdir-command-not-found/8710
- run: export PATH="$PATH:$HOME/.local/bin"
- run: |
pip install awscli
docker load -i scope.tar
docker load -i cloud-agent.tar
test -z "${DOCKER_USER}" || (
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS &&
(test "${DOCKER_ORGANIZATION:-$DOCKER_USER}" = "weaveworks" || (
for IMAGE in $IMAGES; do
docker tag weaveworks/$IMAGE:latest ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:latest &&
docker tag weaveworks/$IMAGE:$(./tools/image-tag) ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:$(./tools/image-tag)
done
)) &&
for IMAGE in $IMAGES; do
docker push ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE &&
- run: |
test -z "${DOCKER_USER}" && exit 0
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
for IMAGE in $IMAGES; do
test "${DOCKER_ORGANIZATION:-$DOCKER_USER}" = "weaveworks" || docker tag weaveworks/$IMAGE:latest ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:latest
docker tag weaveworks/$IMAGE:latest ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:$(./tools/image-tag)
docker push ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:latest
docker push ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:$(./tools/image-tag)
done
)
done
- run: |
test -z "${QUAY_USER}" || (
docker login -e '.' -u "$QUAY_USER" -p "$QUAY_PASSWORD" quay.io &&
docker tag weaveworks/scope:$(./tools/image-tag) "quay.io/${QUAY_ORGANIZATION}/scope:$(./tools/image-tag)" &&
docker push "quay.io/${QUAY_ORGANIZATION}/scope:$(./tools/image-tag)"
)
- run: test -z "${UI_BUCKET_KEY_ID}" || (make ui-upload && make ui-pkg-upload)
test -z "${QUAY_USER}" && exit 0
docker login -e '.' -u "$QUAY_USER" -p "$QUAY_PASSWORD" quay.io
docker tag weaveworks/scope:$(./tools/image-tag) "quay.io/${QUAY_ORGANIZATION}/scope:$(./tools/image-tag)"
docker push "quay.io/${QUAY_ORGANIZATION}/scope:$(./tools/image-tag)"
- run: test -z "${UI_BUCKET_KEY_ID}" || (make BUILD_IN_CONTAINER=false ui-upload ui-pkg-upload)

0 comments on commit 1734def

Please sign in to comment.