-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildspec.yml
More file actions
55 lines (48 loc) · 1.8 KB
/
buildspec.yml
File metadata and controls
55 lines (48 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
version: 0.2
env:
variables:
PIPENV_VENV_IN_PROJECT: "true"
phases:
install:
runtime-versions:
python: 3.7
docker: 18
commands:
- sudo python -m pip install --upgrade pip
- sudo pip install --upgrade pip
- sudo pip install pipenv
- sudo pipenv install
- sudo pipenv install Django==2.2
- sudo pipenv install pytest-django
finally:
- echo Install phase complete...
build:
commands:
- [ $EUID == 0 ] && SUDO=" || SUDO=sudo && $SUDO chown -R circleci:circleci /usr/local/bin
- [ $EUID == 0 ] && SUDO=" || SUDO=sudo && $SUDO chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
- sudo pipenv run pytest --junitxml=test-results/junit.xml djangodemo/tests
- sudo python djangodemo/setup.py sdist
post_build:
commands:
- echo Building Docker Image...
- cd ${CODEBUILD_SRC_DIR}
- docker login --username tylertravismya --password 69cutlass
- docker build -t theharbormaster/django-demo:latest .
- docker push theharbormaster/django-demo:latest
- echo Installing Terraform...
- wget https://releases.hashicorp.com/terraform/0.11.13/terraform_0.11.13_linux_amd64.zip
- unzip ./terraform_0.11.13_linux_amd64.zip -d /usr/local/bin/
- terraform -v
- echo Running Terraform plan...
- echo initializaing terraform
- cd terraform && terraform init --input=false"
- echo running terraform plan
- terraform plan --input=false --out=terraform.plan -var host=https://xxx.xxx.xxx.xxx -var username= -var password= -var region=- -var project=
- echo running terraform plan
terraform apply -auto-approve "terraform.plan"
artifacts:
files:
- djangodemo/*.egg-info
cache:
paths:
- '/root/.cache/pip'