Skip to content

Commit

Permalink
Merge pull request #3841 from weaveworks/aws-cli-docker
Browse files Browse the repository at this point in the history
Run AWS CLI from a container image
  • Loading branch information
bboreham authored Apr 7, 2021
2 parents 2b9a7a0 + 8577003 commit f0b4094
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,16 @@ jobs:
path: /tmp/artifacts

deploy:
<<: *defaults
machine:
image: circleci/classic:201709-01
working_directory: /home/circleci/src/github.com/weaveworks/scope
environment:
IMAGES: scope cloud-agent
steps:
- checkout
- setup_remote_docker
- attach_workspace:
at: .
- run: |
pip install awscli
docker load -i scope.tar
docker load -i cloud-agent.tar
- run: |
Expand Down
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,18 @@ $(SCOPE_BACKEND_BUILD_UPTODATE): backend/*
$(SUDO) docker tag $(SCOPE_BACKEND_BUILD_IMAGE) $(SCOPE_BACKEND_BUILD_IMAGE):$(IMAGE_TAG)
touch $@

# Run aws CLI from a container image so we don't have to install Python, etc.
AWS_COMMAND=docker run $(RM) $(RUN_FLAGS) \
-e AWS_ACCESS_KEY_ID=$$UI_BUCKET_KEY_ID \
-e AWS_SECRET_ACCESS_KEY=$$UI_BUCKET_KEY_SECRET \
-v $(shell pwd):/scope \
amazon/aws-cli:2.1.35

ui-upload: client/build-external/index.html
AWS_ACCESS_KEY_ID=$$UI_BUCKET_KEY_ID \
AWS_SECRET_ACCESS_KEY=$$UI_BUCKET_KEY_SECRET \
aws s3 cp client/build-external/ s3://static.weave.works/scope-ui/ --recursive --exclude '*.html'
$(AWS_COMMAND) s3 cp /scope/client/build-external/ s3://static.weave.works/scope-ui/ --recursive --exclude '*.html'

ui-pkg-upload: client/bundle/weave-scope.tgz
AWS_ACCESS_KEY_ID=$$UI_BUCKET_KEY_ID \
AWS_SECRET_ACCESS_KEY=$$UI_BUCKET_KEY_SECRET \
aws s3 cp client/bundle/weave-scope.tgz s3://weaveworks-js-modules/weave-scope/$(shell echo $(SCOPE_VERSION))/weave-scope.tgz
$(AWS_COMMAND) s3 cp /scope/client/bundle/weave-scope.tgz s3://weaveworks-js-modules/weave-scope/$(shell echo $(SCOPE_VERSION))/weave-scope.tgz

# We don't rmi images here; rm'ing the .uptodate files is enough to
# get the build images rebuilt, and rm'ing the scope exe is enough to
Expand Down

0 comments on commit f0b4094

Please sign in to comment.