-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
47 lines (38 loc) · 1.33 KB
/
.travis.yml
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
dist: xenial
language: python
python:
- '3.7'
sudo : required
services:
- docker
env:
global:
# create an environment variable for the git sha
- SHA=$(git rev-parse HEAD)
# this prevents any interactions with the Gcloud
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
notifications:
slack: kpacademy:EgN7sVj1SL6pDORdKLgH46a4
before_install:
# setting up json credentials for google cloud
- openssl aes-256-cbc -K $encrypted_0c35eebf403c_key -iv $encrypted_0c35eebf403c_iv -in credentials.json.enc -out credentials.json -d
# google cloud sdk configuration
- curl https://sdk.cloud.google.com | bash > /dev/null;
- source $HOME/google-cloud-sdk/path.bash.inc
- gcloud components update kubectl
# configuring google cloud cluster set up
- gcloud auth activate-service-account --key-file credentials.json
- gcloud config set project new-project-240200
- gcloud config set compute/zone us-east1-b
- gcloud container clusters get-credentials standard-cluster-1
# logging into docker
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# building our test environment
- docker build -t farhansajid2/django-test -f ./docker/dev/Dockerfile.dev .
script:
- docker run farhansajid2/django-test python manage.py test
deploy:
provider: script
script: bash ./deploy.sh
on:
branch: master