Skip to content

Commit 8c3fe73

Browse files
committed
Add circleci configs
1 parent 32311fb commit 8c3fe73

2 files changed

Lines changed: 68 additions & 1 deletion

File tree

.circleci/config.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
version: 2.1
2+
3+
#orbs:
4+
# aws-ecr: circleci/aws-ecr@4.0.1
5+
6+
workflows:
7+
build_test_deploy:
8+
jobs:
9+
- build_test
10+
# - docker_hub_build_push_image:
11+
# requires:
12+
# - build_test
13+
# - aws-ecr/build_and_push_image:
14+
# region: ${AWS_REGION}
15+
# account-url: ${AWS_ECR_ACCOUNT_URL}
16+
# repo: ${CIRCLE_PROJECT_REPONAME}
17+
# tag: ${CIRCLE_BUILD_NUM}
18+
# requires:
19+
# - build_test
20+
21+
jobs:
22+
build_test:
23+
docker:
24+
- image: circleci/python:3.7.1
25+
steps:
26+
- checkout
27+
- run: sudo chown -R circleci:circleci /usr/local/bin
28+
29+
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.6/site-packages
30+
31+
- restore_cache: # ensure this step occurs *before* installing dependencies
32+
key: deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
33+
34+
- run:
35+
command: | # use pipenv to install dependencies
36+
sudo pip install pipenv
37+
pipenv install
38+
39+
- save_cache:
40+
key: deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
41+
paths:
42+
- ".venv"
43+
- "/usr/local/bin"
44+
- "/usr/local/lib/python3.6/site-packages"
45+
46+
# Run tests
47+
- run: pipenv run pytest
48+
49+
- store_test_results:
50+
path: test-results
51+
- store_artifacts:
52+
path: test-results
53+
destination: tr1
54+
55+
docker_hub_build_push_image:
56+
docker:
57+
- image: circleci/python:3.7.1
58+
59+
steps:
60+
- checkout
61+
- setup_remote_docker:
62+
docker_layer_caching: true
63+
64+
- run:
65+
name: Build and push Docker image to Docker Hub
66+
command: |
67+
echo "todo"

bin/publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fi
1616

1717
if [[ -n "$DOCKER_USERNAME" ]] && [[ -n "$DOCKER_PASSWORD" ]]; then
1818
echo "Logging in using ENV creds"
19-
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
19+
echo ${DOCKER_PASSWORD} | docker login -u ${DOCKER_USERNAME} --password-stdin
2020
fi
2121

2222
echo "Pushing image $IMAGE_NAME:$TRAVIS_BRANCH"

0 commit comments

Comments
 (0)