Browse Source

💚update my circleci

test
denisdalmeida04@gmail.com 6 years ago
parent
commit
5675a77c66
  1. 92
      .circleci/config.yml

92
.circleci/config.yml

@ -1,86 +1,98 @@
workflows:
version: 2
build_circleci:
jobs:
- build
- initialise:
requires:
- build
- docker-build-and-push:
requires:
- initialise
- back-deploy-heroku:
requires:
- docker-build-and-push
version: 2
---
jobs: jobs:
build: build:
docker: docker:
- image: circleci/python:3.7.4
-
image: "circleci/python:3.7.4"
steps: steps:
- checkout - checkout
- run:
name: install pyth dependencies
-
run:
command: | command: |
python3 -m venv venv python3 -m venv venv
. venv/bin/activate . venv/bin/activate
pip install -r requirements/dev.txt pip install -r requirements/dev.txt
environment: environment:
CONDUIT_SECRET: 'something-really-secret'
CONDUIT_SECRET: something-really-secret
FLASK_APP: /home/circleci/repo/autoapp.py FLASK_APP: /home/circleci/repo/autoapp.py
FLASK_DEBUG: 1 FLASK_DEBUG: 1
- save_cache:
name: "install pyth dependencies"
-
save_cache:
key: "v2-dependencies-{{ checksum \"requirements/dev.txt\" }}-{{ checksum \"requirements/prod.txt\" }}"
paths: paths:
- ./venv - ./venv
key: v2-dependencies-{{ checksum "requirements/dev.txt" }}-{{ checksum "requirements/prod.txt" }}
initialise: initialise:
docker: docker:
- image: circleci/python:3.7.4
-
environment: environment:
DATABASE_URL: postgresql://myuser:somePwd@localhost:5432/mydb
- image: circleci/postgres:9.6.5-alpine
DATABASE_URL: "postgresql://myuser:somePwd@localhost:5432/mydb"
image: "circleci/python:3.7.4"
-
environment: environment:
POSTGRES_DB: mydb POSTGRES_DB: mydb
POSTGRES_USER: myuser
POSTGRES_PASSWORD: somePwd POSTGRES_PASSWORD: somePwd
POSTGRES_USER: myuser
image: "circleci/postgres:9.6.5-alpine"
steps: steps:
- checkout - checkout
- restore_cache:
-
restore_cache:
keys: keys:
- v2-dependencies-{{ checksum "requirements/dev.txt" }}-{{ checksum "requirements/prod.txt" }}
- "v2-dependencies-{{ checksum \"requirements/dev.txt\" }}-{{ checksum \"requirements/prod.txt\" }}"
- v2-dependencies- - v2-dependencies-
- run:
name: flask upgrade
-
run:
command: | command: |
. venv/bin/activate . venv/bin/activate
sleep 1 sleep 1
flask db upgrade flask db upgrade
environment: environment:
CONDUIT_SECRET: 'something-really-secret'
CONDUIT_SECRET: something-really-secret
DATABASE_URL: "postgresql://myuser:somePwd@localhost:5432/mydb"
FLASK_APP: /home/circleci/repo/autoapp.py FLASK_APP: /home/circleci/repo/autoapp.py
DATABASE_URL: postgresql://myuser:somePwd@localhost:5432/mydb
FLASK_DEBUG: 1 FLASK_DEBUG: 1
POSTGRES_DB: mydb POSTGRES_DB: mydb
POSTGRES_USER: myuser
POSTGRES_PASSWORD: somePwd POSTGRES_PASSWORD: somePwd
POSTGRES_PORT: 5432 POSTGRES_PORT: 5432
- run:
name: flask test
POSTGRES_USER: myuser
name: "flask upgrade"
-
run:
command: | command: |
. venv/bin/activate . venv/bin/activate
sleep 1 sleep 1
flask test flask test
environment: environment:
CONDUIT_SECRET: 'something-really-secret'
CONDUIT_SECRET: something-really-secret
DATABASE_URL: "postgresql://myuser:somePwd@localhost:5432/mydb"
FLASK_APP: /home/circleci/repo/autoapp.py FLASK_APP: /home/circleci/repo/autoapp.py
DATABASE_URL: postgresql://myuser:somePwd@localhost:5432/mydb
FLASK_DEBUG: 1 FLASK_DEBUG: 1
POSTGRES_DB: mydb POSTGRES_DB: mydb
POSTGRES_USER: myuser
POSTGRES_PASSWORD: somePwd POSTGRES_PASSWORD: somePwd
POSTGRES_PORT: 5432 POSTGRES_PORT: 5432
- save_cache:
POSTGRES_USER: myuser
name: "flask test"
-
key: "v3-dependencies-{{ checksum \"requirements/dev.txt\" }}-{{ checksum \"requirements/prod.txt\" }}"
paths: paths:
- venv - venv
key: v3-dependencies-{{ checksum "requirements/dev.txt" }}-{{ checksum "requirements/prod.txt" }}
save_cache: ~
version: 2
workflows:
build_circleci:
jobs:
- build
-
initialise:
requires:
- build
-
docker-build-and-push:
requires:
- initialise
-
back-deploy-heroku:
requires:
- docker-build-and-push
version: 2
Loading…
Cancel
Save