Skip to content

Commit

Permalink
Circle 1->2 (#10)
Browse files Browse the repository at this point in the history
* Circle 1->2

* Explicit library name
  • Loading branch information
moshez committed Jul 6, 2018
1 parent 9ac9e6f commit e31d5ce
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 35 deletions.
171 changes: 171 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
#
# Globality autogenerated CircleCI configuration
#
# This file is auto generated with globality-build.
# You should not make any changes to this file manually
#
# Any changes made to this file will be overwritten in the
# next version of the build.
#
# See: http://github.com/globality-corp/globality-buid
#
#

defaults: &defaults
working_directory: ~/repo
docker:
- image: ${AWS_ECR_DOMAIN}/globality-build:stable
aws_auth:
aws_access_key_id: ${AWS_ACCESS_KEY_ID}
aws_secret_access_key: ${AWS_SECRET_ACCESS_KEY}
environment:
EXTRA_INDEX_URL: "InjectedDuringRuntime"
AWS_ECR_DOMAIN: "InjectedDuringRuntime"
JFROG_AUTH: "InjectedDuringRuntime"
PYPI_USERNAME: "InjectedDuringRuntime"
PYPI_PASSWORD: "InjectedDuringRuntime"

deploy_defaults: &deploy_defaults
working_directory: ~/repo
docker:
- image: ${AWS_ECR_DOMAIN}/globality-build:stable
aws_auth:
aws_access_key_id: ${AWS_ACCESS_KEY_ID}
aws_secret_access_key: ${AWS_SECRET_ACCESS_KEY}
environment:
EXTRA_INDEX_URL: "InjectedDuringRuntime"
AWS_ECR_DOMAIN: "InjectedDuringRuntime"
JFROG_AUTH: "InjectedDuringRuntime"
PYPI_USERNAME: "InjectedDuringRuntime"
PYPI_PASSWORD: "InjectedDuringRuntime"

whitelist: &whitelist
paths:
.

version: 2

jobs:
checkout:
<<: *defaults

steps:
- checkout

- persist_to_workspace:
root: ~/repo
<<: *whitelist

build_base_docker:
<<: *defaults

steps:
- attach_workspace:
at: ~/repo

- setup_remote_docker

- run:
name: Build Base Docker
# install dependencies for loading ecs task definitions
command: |
eval $(aws ecr get-login --no-include-email)
python -m middlefield globality build build-gen --config .globality/build.json
python -m middlefield globality build docker-base --repo flake8-logging-format
python -m middlefield globality build docker --repo flake8-logging-format
test:
<<: *defaults

steps:
- attach_workspace:
at: ~/repo

- setup_remote_docker
- run:
name: Test code
command: |
docker create -v /src/logging_format/tests/ --name service_tests alpine:3.4 /bin/true
docker cp $(pwd)/logging_format/tests service_tests:/src/logging_format/
eval $(aws ecr get-login --no-include-email)
docker pull ${AWS_ECR_DOMAIN}/flake8-logging-format:${CIRCLE_SHA1}
docker run -it --volumes-from service_tests ${AWS_ECR_DOMAIN}/flake8-logging-format:${CIRCLE_SHA1} test
lint:
<<: *defaults

steps:
- attach_workspace:
at: ~/repo

- setup_remote_docker

- run:
name: Run Lint
command: |
docker create -v /src/flake8-logging-format/tests/ --name service_tests alpine:3.4 /bin/true
docker cp $(pwd)/logging_format/tests service_tests:/src/logging_format/
eval $(aws ecr get-login --no-include-email)
docker pull ${AWS_ECR_DOMAIN}/flake8-logging-format:${CIRCLE_SHA1}
docker run -it --volumes-from service_tests ${AWS_ECR_DOMAIN}/flake8-logging-format:${CIRCLE_SHA1} lint
deploy:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Deploy
command: |
echo "[distutils]" > ~/.pypirc
echo "index-servers =" >> ~/.pypirc
echo " pypi" >> ~/.pypirc
echo >> ~/.pypirc
echo "[pypi]" >> ~/.pypirc
echo "username:$PYPI_USERNAME" >> ~/.pypirc
echo "password:$PYPI_PASSWORD" >> ~/.pypirc
echo >> ~/.pypirc
python setup.py register -r pypi
python setup.py sdist upload -r pypi
workflows:
version: 2

build-and-release:
jobs:
- checkout:
filters:
# run for all branches and tags
tags:
only: /.*/
- build_base_docker:
requires:
- checkout
filters:
# run for all branches and tags
tags:
only: /.*/
- lint:
requires:
- build_base_docker
filters:
# run for all branches and tags
tags:
only: /.*/
- test:
requires:
- build_base_docker
filters:
# run for all branches and tags
tags:
only: /.*/
- deploy:
requires:
- test
- lint
filters:
branches:
ignore: /.*/
tags:
only: /^[0-9]+(\.[0-9]+)*/
7 changes: 7 additions & 0 deletions .globality/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "python-library",
"params": {
"name": "flake8-logging-format",
"lib_name": "logging_format"
}
}
Empty file added MANIFEST.in
Empty file.
35 changes: 0 additions & 35 deletions circle.yml

This file was deleted.

0 comments on commit e31d5ce

Please sign in to comment.