Closed msheiny closed 5 years ago
rebased on master
currently adding features for google cloud storage
.. do not merge yet :)
How to test with GCE support:
roles/storage.objectViewer
, roles/storage.objectCreator
, roles/cloudsql.client
roles/storage.objectViewer
, roles/storage.objectCreator
, roles/storage.legacyBucketReader
3 . Dump key from that service account and copy inside a new folder called ./creds
diff --git a/ci-docker-compose.yaml b/ci-docker-compose.yaml
index 76247a4..1a19a28 100644
--- a/ci-docker-compose.yaml
+++ b/ci-docker-compose.yaml
@@ -32,6 +32,7 @@ services:
- ${HOST_STATIC_DIR:-stn-django-static}:/django-media
- ${HOST_MEDIA_DIR:-stn-django-static}:/django-static
- ${HOST_LOGS_DIR:-stn-django-logs}:/django-logs
+ - ./creds:/gce-creds
networks:
app:
aliases:
diff --git a/docker/ci.env b/docker/ci.env
docker/ci.env
to look similar to this
+GS_BUCKET_NAME=______________
+GS_PROJECT_ID=__________________
+GS_CREDENTIALS=/gce-creds/${name_of_your_service_account.json}
diff --git a/docker/nginx/proxy.conf b/docker/nginx/proxy.conf
index fd6acdf..4a7b948 100644
--- a/docker/nginx/proxy.conf
+++ b/docker/nginx/proxy.conf
@@ -1,10 +1,6 @@
server {
listen 8080;
location /static { alias /django-static; }
6. Run `docker-compose -f ci-docker-compose.yaml up`
7. Log into the admin `http://localhost:8080/admin/` go to `Images` and upload an arbitrary file
8. You shouldnt see any errors.. make sure your image got dumped to your bucket :) You can use `gsutil` like `gsutil ls -p ${proj_name} gs://${bucket_name}/`
@conorsch any objections to merge here?
hey @harrislapiroff / @ketudb can i get a review here? At the bare minimum you can just confirm it doesn't break anything with the settings disabled.
Or visual review ;)
This is an optional deployment setting controlled via environment variables. Of particular use to me was to ensure that we are able to use IAM roles which will mirror deployment so that is what I tested on pretty exclusively.
Here's a good test plan if you want to mimic that locally:
Rebuild the prod container
make build-prod-container
change the nginx docker config to look like this
location /media {
alias /django-media;
}
location /static {
alias /django-static;
}
location / { proxy_pass http://app:8000; proxy_set_header Host app;