Skip to content

Commit 7e88cd5

Browse files
committed
initial CI for discussion
1 parent b175f6a commit 7e88cd5

File tree

3 files changed

+117
-0
lines changed

3 files changed

+117
-0
lines changed

.circleci/circleci-readme.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
CI Debug Notes
2+
================
3+
To validate some circleci stuff, I was able to run a “build locally” using the steps below.
4+
The local build runs in a docker container.
5+
6+
* (Once) Install circleci client (`brew install circleci`)
7+
8+
* Convert the “real” config.yml into a self contained (non-workspace) config via:
9+
10+
circleci config process .circleci/config.yml > .circleci/local-config.yml
11+
12+
* Run a local build with the following command:
13+
14+
circleci local execute -c .circleci/local-config.yml --job 'build'
15+
16+
Typically, both commands are run together:
17+
18+
circleci config process .circleci/config.yml > .circleci/local-config.yml && circleci local execute -c .circleci/local-config.yml --job 'build'
19+
20+
With the above command, operations that cannot occur during a local build will show an error like this:
21+
22+
```
23+
... Error: FAILED with error not supported
24+
```
25+
26+
However, the build will proceed and can complete “successfully”, which allows you to verify scripts in your config, etc.
27+
28+
If the build does complete successfully, you should see a happy green <span style="color:green">Success!</span> message.

.circleci/config.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Copyright 2019-present Sonatype Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
version: 2.1
16+
17+
executors:
18+
python:
19+
docker:
20+
- image: circleci/python:3.7
21+
22+
jobs:
23+
publish:
24+
executor: python
25+
environment:
26+
PIPENV_VENV_IN_PROJECT: true
27+
steps:
28+
- add_ssh_keys:
29+
fingerprints:
30+
# TODO: change fingerprint
31+
- "4f:7d:6b:26:dc:44:de:b0:4d:f1:96:50:2a:b5:bd:b3"
32+
- checkout
33+
- run:
34+
name: Setup Python environment
35+
command: |
36+
# TODO: do stuff, like setup venv, poetry, pip etc
37+
- run:
38+
command: |
39+
# TODO: perform publish steps, maybe using python-semantic-release
40+
41+
build:
42+
executor: python
43+
environment:
44+
PIPENV_VENV_IN_PROJECT: true
45+
steps:
46+
- checkout
47+
- run:
48+
name: Setup Python environment
49+
command: |
50+
# TODO: do stuff, like setup .venv, poetry, pip etc.
51+
- run:
52+
name: Run tests
53+
command: |
54+
# TODO: maybe run pylint and run those tests
55+
- run:
56+
name: Run self scan
57+
command: |
58+
# TODO: audit with jake maybe?
59+
- store_test_results: # Upload test results for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
60+
path: test-results
61+
- store_artifacts: # Upload test summary for display in Artifacts: https://circleci.com/docs/2.0/artifacts/
62+
path: test-results
63+
destination: tr1
64+
65+
workflows:
66+
version: 2
67+
build_and_test_and_publish:
68+
jobs:
69+
- build
70+
# TODO: enable to publish after successful build
71+
# - publish:
72+
# filters:
73+
# branches:
74+
# only: main
75+
# context: pypi
76+
# requires:
77+
# - build
78+
79+
build_nightly:
80+
triggers:
81+
- schedule:
82+
cron: "35 20 * * *"
83+
filters:
84+
branches:
85+
only: main
86+
jobs:
87+
- build

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# ci config for local ci build
2+
/.circleci/local-config.yml

0 commit comments

Comments
 (0)