Browse Source

Merge branch 'main' into dependabot/pip/jinja2-2.10.1

dependabot/pip/jinja2-2.10.1
PierreD 5 years ago
committed by GitHub
parent
commit
f3467f4499
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 132
      .circleci/config.yml
  2. 9
      Dockerfile
  3. 12
      Pipfile.lock
  4. 2
      Procfile
  5. 1
      conduit/settings.py

132
.circleci/config.yml

@ -0,0 +1,132 @@
version: 2 # use CircleCI 2.0
jobs: # A basic unit of work in a run
build: # runs not using Workflows must have a `build` job as entry point
# directory where steps are run
working_directory: ~/repo
docker: # run the steps with Docker
# CircleCI Python images available at: https://hub.docker.com/r/circleci/python/
- image: circleci/python:3.9.1
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
environment: # environment variables for primary container
PIPENV_VENV_IN_PROJECT: true
DATABASE_URL: postgresql://circle_test:pwd@localhost:5432/circle_test
# CircleCI PostgreSQL images available at: https://hub.docker.com/r/circleci/postgres/
- image: circleci/postgres:9.6.9-alpine
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
environment: # environment variables for the Postgres container.
POSTGRES_USER: circle_test
POSTGRES_PASSOWRD: pwd
POSTGRES_DB: circle_test
steps: # steps that comprise the `build` job
- checkout # check out source code to working directory
# - run: sudo chown -R circleci:circleci /usr/local/bin
# - run: sudo chown -R circleci:circleci /usr/local/lib/python3.8/site-packages
- restore_cache:
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
key: deps10-{{ .Branch }}-{{ checksum "requirements/dev.txt" }}
- run:
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements/dev.txt
environment:
CONDUIT_SECRET: "something-really-secret"
FLASK_APP: autoapp.py
FLASK_DEBUG: 1
DATABASE_URL: postgresql://circle_test:pwd@localhost:5432/circle_test
- save_cache: # cache Python dependencies using checksum of Pipfile as the cache-key
key: deps10-{{ .Branch }}-{{ checksum "requirements/dev.txt" }}
paths:
- "venv"
- store_test_results: # Upload test results for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
path: test-results
- store_artifacts: # Upload test summary for display in Artifacts: https://circleci.com/docs/2.0/artifacts/
path: test-results
destination: tr1
test:
docker:
- image: circleci/python:3.9.1
- image: circleci/postgres:9.6.9-alpine
environment:
POSTGRES_USER: circle_test
POSTGRES_PASSOWRD: pwd
POSTGRES_DB: circle_test
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- deps10-{{ .Branch }}-{{ checksum "requirements/dev.txt" }}
- deps10-{{ .Branch }}-
- run:
command: |
. venv/bin/activate
sleep 1
flask db stamp head
flask db migrate
flask db upgrade
# flask db test
environment:
CONDUIT_SECRET: "something-really-secret"
FLASK_APP: autoapp.py
FLASK_DEBUG: 1
DATABASE_URL: postgresql://circle_test:pwd@localhost:5432/circle_test
- save_cache: # cache Python dependencies using checksum of Pipfile as the cache-key
key: deps10-{{ .Branch }}-{{ checksum "requirements/dev.txt" }}
paths:
- "venv"
heroku:
docker:
- image: buildpack-deps:trusty
working_directory: ~/repo
steps:
- checkout
- run:
name: Heroku Deploy
command: git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git main
docker_build_push:
working_directory: /dockerapp
docker:
- image: docker:17.05.0-ce-git
steps:
- checkout
- setup_remote_docker
- run:
name: Build application Docker image
command: |
docker build --cache-from=app -t app .
- deploy:
name: Publish application to docker hub
command: |
docker login -e $DOCKER_HUB_EMAIL -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
docker tag app $DOCKERHUB_USERNAME/dev_ops_back_container:$CIRCLE_BUILD_NUM
docker tag app $DOCKERHUB_USERNAME/dev_ops_back_container:latest
docker push $DOCKERHUB_USERNAME/dev_ops_back_container:$CIRCLE_BUILD_NUM
docker push $DOCKERHUB_USERNAME/dev_ops_back_container:latest
workflows:
version: 2
build-test:
jobs:
- build
- test:
requires:
- build
- heroku:
requires:
- build
- test
- docker_build_push:
requires:
- build
- test

9
Dockerfile

@ -0,0 +1,9 @@
FROM python:3.9.1
COPY . /app
ENV FLASK_APP=autoapp.py
RUN pip install -r /app/requirements/dev.txt
CMD python /app/autoapp.py

12
Pipfile.lock

@ -168,11 +168,13 @@
}, },
"jinja2": { "jinja2": {
"hashes": [ "hashes": [
dependabot/pip/jinja2-2.10.1
"sha256:065c4f02ebe7f7cf559e49ee5a95fb800a9e4528727aec6f24402a5374c65013", "sha256:065c4f02ebe7f7cf559e49ee5a95fb800a9e4528727aec6f24402a5374c65013",
"sha256:14dd6caf1527abb21f08f86c784eac40853ba93edb79552aa1e4b8aef1b61c7b" "sha256:14dd6caf1527abb21f08f86c784eac40853ba93edb79552aa1e4b8aef1b61c7b"
], ],
"index": "pypi", "index": "pypi",
"version": "==2.10.1" "version": "==2.10.1"
main
}, },
"mako": { "mako": {
"hashes": [ "hashes": [
@ -302,10 +304,10 @@
}, },
"sqlalchemy": { "sqlalchemy": {
"hashes": [ "hashes": [
"sha256:e21e5561a85dcdf16b8520ae4daec7401c5c24558e0ce004f9b60be75c4b6957"
"sha256:11ead7047ff3f394ed0d4b62aded6c5d970a9b718e1dc6add9f5e79442cc5b14"
], ],
"index": "pypi", "index": "pypi",
"version": "==1.2.9"
"version": "==1.3.0"
}, },
"unicode-slugify": { "unicode-slugify": {
"hashes": [ "hashes": [
@ -330,11 +332,11 @@
}, },
"werkzeug": { "werkzeug": {
"hashes": [ "hashes": [
"sha256:c3fd7a7d41976d9f44db327260e263132466836cef6f91512889ed60ad26557c",
"sha256:d5da73735293558eb1651ee2fddc4d0dedcfa06538b8813a2e20011583c9e49b"
"sha256:97660b282aa7e29f94f3fe378e5c7162d7ab9d601a8dbb1cbb2ffc8f0e54607d",
"sha256:cfd1281b1748288e59762c0e174d64d8bcb2b70e7c57bc4a1203c8825af24ac3"
], ],
"index": "pypi", "index": "pypi",
"version": "==0.14.1"
"version": "==0.15.3"
} }
}, },
"develop": { "develop": {

2
Procfile

@ -1 +1 @@
web: gunicorn autoapp:app -b 0.0.0.0:$PORT -w 3
web: flask db upgrade;gunicorn autoapp:app -b 0.0.0.0:$PORT -w 3

1
conduit/settings.py

@ -25,6 +25,7 @@ class Config(object):
'http://localhost:4200', 'http://localhost:4200',
'http://0.0.0.0:4000', 'http://0.0.0.0:4000',
'http://localhost:4000', 'http://localhost:4000',
'https://super-cool-site-by-pierredarcas.netlify.app/#/',
] ]
JWT_HEADER_TYPE = 'Token' JWT_HEADER_TYPE = 'Token'

Loading…
Cancel
Save