Skip to content

Commit

Permalink
Merge branch 'release/1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhadani committed Sep 22, 2020
2 parents 96c038e + 0a20516 commit 685e6c5
Show file tree
Hide file tree
Showing 21 changed files with 483 additions and 74 deletions.
1 change: 1 addition & 0 deletions .ackrc
Expand Up @@ -9,6 +9,7 @@

# Python project settings
--ignore-dir=.eggs/
--ignore-dir=.mypy_cache/
--ignore-dir=.tox/
--ignore-dir=build/
--ignore-dir=cover/
3 changes: 1 addition & 2 deletions .bumpversion.cfg
@@ -1,9 +1,8 @@
[bumpversion]
current_version = 1.0.0
current_version = 1.0.1
commit = False
tag = False

[bumpversion:file:setup.py]
search = version = "{current_version}"
replace = version = "{new_version}"

256 changes: 256 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,256 @@
#
# 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-build
#
#

defaults: &defaults
working_directory: ~/repo
docker:
- image: ${AWS_ECR_DOMAIN}/globality-build:2020.37.0
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:2020.37.0
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_docker:
<<: *defaults

steps:
- attach_workspace:
at: ~/repo

- setup_remote_docker:
docker_layer_caching: true

- run:
name: Login AWS ECR
command: |
eval $(aws ecr get-login --no-include-email)
- run:
name: Build Docker - Application Service Code
command: |
# pwd is here to prevent error when pre_docker_build returns nothing
pwd
docker build --tag $AWS_ECR_DOMAIN/python-library:$CIRCLE_SHA1 \
--build-arg BUILD_NUM=$CIRCLE_BUILD_NUM \
--build-arg SHA1=$CIRCLE_SHA1 \
--build-arg EXTRA_INDEX_URL=$EXTRA_INDEX_URL \
--build-arg JFROG_AUTH=$JFROG_AUTH .
docker push $AWS_ECR_DOMAIN/python-library:$CIRCLE_SHA1
test:
<<: *defaults

steps:
- attach_workspace:
at: ~/repo

- setup_remote_docker
- run:
name: Login AWS ECR
command: |
eval $(aws ecr get-login --no-include-email)
- run:
name: Copy service tests to volume
command: |
docker create -v /src/microcosm_resourcesync/tests/ --name service_tests alpine:3.11 /bin/true
docker cp $(pwd)/microcosm_resourcesync/tests service_tests:/src/microcosm_resourcesync/
- run:
name: Run Test
command: |
docker run -it --volumes-from service_tests ${AWS_ECR_DOMAIN}/python-library:${CIRCLE_SHA1} test
lint:
<<: *defaults

steps:
- attach_workspace:
at: ~/repo

- setup_remote_docker
- run:
name: Login AWS ECR
command: |
eval $(aws ecr get-login --no-include-email)
- run:
name: Copy service tests to volume
command: |
docker create -v /src/microcosm_resourcesync/tests/ --name service_tests alpine:3.11 /bin/true
docker cp $(pwd)/microcosm_resourcesync/tests service_tests:/src/microcosm_resourcesync/
- run:
name: Run Lint
command: |
docker run -it --volumes-from service_tests ${AWS_ECR_DOMAIN}/python-library:${CIRCLE_SHA1} lint
typehinting:
<<: *defaults

steps:
- attach_workspace:
at: ~/repo

- setup_remote_docker
- run:
name: Login AWS ECR
command: |
eval $(aws ecr get-login --no-include-email)
- run:
name: Copy service tests to volume
command: |
docker create -v /src/microcosm_resourcesync/tests/ --name service_tests alpine:3.11 /bin/true
docker cp $(pwd)/microcosm_resourcesync/tests service_tests:/src/microcosm_resourcesync/
- run:
name: Run Typehinting
command: |
docker run -it --volumes-from service_tests ${AWS_ECR_DOMAIN}/python-library:${CIRCLE_SHA1} typehinting
deploy_jfrog_rc:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Deploy
command: |
echo "Not publishing package!"
publish_library:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Publish
command: |
echo "[distutils]" > ~/.pypirc
echo "index-servers =" >> ~/.pypirc
echo " pypi " >> ~/.pypirc
echo >> ~/.pypirc
echo "[pypi]" >> ~/.pypirc
echo "repository:https://upload.pypi.org/legacy/" >> ~/.pypirc
echo "username:$PYPI_USERNAME" >> ~/.pypirc
echo "password:$PYPI_PASSWORD" >> ~/.pypirc
echo >> ~/.pypirc
version=$(cat .bumpversion.cfg | awk '/current_version / {print $3}')
python setup.py register -r pypi
python setup.py sdist
twine upload --repository pypi dist/microcosm-resourcesync-${version}.tar.gz
workflows:
version: 2

build-and-release:
jobs:
- checkout:
filters:
# run for all branches and tags
tags:
only: /.*/
- build_docker:
requires:
- checkout
filters:
# run for all branches and tags
tags:
only: /.*/
- lint:
requires:
- build_docker
filters:
# run for all branches and tags
tags:
only: /.*/
- test:
requires:
- build_docker
filters:
# run for all branches and tags
tags:
only: /.*/
- deploy_jfrog_rc:
requires:
- test
- lint
- typehinting
- typehinting:
requires:
- build_docker
filters:
# run for all branches and tags
tags:
only: /.*/
- publish_library:
requires:
- test
- lint
- typehinting
filters:
branches:
ignore: /.*/
tags:
only: /^[0-9]+(\.[0-9]+)*/


13 changes: 13 additions & 0 deletions .dockerignore
@@ -0,0 +1,13 @@
*
!microcosm_resourcesync
microcosm_resourcesync/tests
!dist/*-none-any.whl
!entrypoint.sh
!MANIFEST.in
!README.md
!requirements.txt
!setup.py
!setup.cfg
**/*.pyc
**/*~

2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -92,3 +92,5 @@ docs/_build/

# PyBuilder
target/

.mypy_cache
10 changes: 10 additions & 0 deletions .globality/build.json
@@ -0,0 +1,10 @@
{
"params": {
"name": "microcosm-resourcesync",
"pypi": {
"repository": "pypi"
}
},
"type": "python-library",
"version": "2020.37.0"
}

0 comments on commit 685e6c5

Please sign in to comment.