This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.static_volume.inner(): "/app/static:ro", | |
}, | |
- "environment": {"DATABASE_URL": self.db_url} | |
+ "environment": { | |
+ "DATABASE_URL": self.db_url, | |
+ "ALLOWED_HOSTS": "0.0.0.0", | |
+ }, | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[...] | |
test.py:18: AssertionError | |
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | |
> /Users/jamie/ws/seaworthy-demo/seaworthy/test.py(18)test_admin_page() | |
-> assert response.status_code == 200 | |
(Pdb) client.get("/admin") | |
<Response [400]> | |
(Pdb) client.get("/admin").text | |
'\n<!DOCTYPE html>\n<html lang="en">\n[...] | |
<!--a lot of unformatted HTML--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test.py::test_admin_page FAILED | |
====================================== FAILURES ====================================== | |
__________________________________ test_admin_page ___________________________________ | |
nginx_container = <fixtures.NginxContainer object at 0x1069b1cf8> | |
def test_admin_page(nginx_container): | |
client = nginx_container.http_client() | |
response = client.get("/admin") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_admin_page(nginx_container): | |
client = nginx_container.http_client() | |
response = client.get("/admin") | |
assert response.status_code == 200 | |
assert "text/html" in response.headers["content-type"] | |
assert "<title>Log in | Django site admin</title>" in response.text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create definition instances | |
socket_volume = VolumeDefinition("socket") | |
static_volume = VolumeDefinition("static") | |
django_container = DjangoContainer("django", socket_volume, static_volume, | |
postgresql_container.database_url()) | |
# Create pytest fixtures | |
socket_volume_fixture = socket_volume.pytest_fixture("socket_volume") | |
static_volume_fixture = static_volume.pytest_fixture("static_volume") | |
django_fixture = django_container.pytest_fixture( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from seaworthy.definitions import ContainerDefinition | |
class DjangoContainer(ContainerDefinition): | |
IMAGE = "seaworthy-demo:django" | |
WAIT_PATTERNS = (r"Booting worker",) | |
def __init__(self, name, socket_volume, static_volume, db_url): | |
super().__init__(name, self.IMAGE, self.WAIT_PATTERNS) | |
self.socket_volume = socket_volume | |
self.static_volume = static_volume |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
before_deploy: | |
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS" | |
- pip install docker-ci-deploy==0.3.0 | |
deploy: | |
provider: script | |
script: dcd --version "$version" --version-latest "$IMAGE_TAG" | |
on: | |
branch: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
before_deploy: | |
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS" | |
- docker tag "$IMAGE_NAME" "${IMAGE_NAME}:latest" | |
- docker tag "$IMAGE_NAME" "${IMAGE_NAME}:${version}" | |
deploy: | |
provider: script | |
script: docker push "${IMAGE_NAME}:latest" && docker push "${IMAGE_NAME}:${version}" | |
on: | |
branch: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo: required | |
dist: trusty | |
python: '3.6' | |
services: | |
- docker | |
env: | |
- IMAGE_NAME=acme-corp/cake-service | |
- REGISTRY_USER=acme-bot | |
# REGISTRY_PASS=... | |
- secret: "<something long>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
tag_in="$1"; shift | |
[ $# -gt 0 ] | |
for tag_out in "$@"; do docker tag "$tag_in" "$tag_out"; done | |
for tag_out in "$@"; do docker push "$tag_out"; done |