File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change 1616
1717if [[ -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
2020fi
2121
2222echo " Pushing image $IMAGE_NAME :$TRAVIS_BRANCH "
You can’t perform that action at this time.
0 commit comments