Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 90e8e3e

Browse files
author
Samuel Hassine
committed
Add CircleCI to the Python client
1 parent 70de11c commit 90e8e3e

File tree

5 files changed

+147
-6
lines changed

5 files changed

+147
-6
lines changed

.circleci/config.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
version: 2.1
2+
3+
jobs:
4+
build:
5+
working_directory: ~/opencti-client
6+
docker:
7+
- image: circleci/python:3.6
8+
steps:
9+
- checkout
10+
- run:
11+
name: build
12+
command: python3 setup.py sdist
13+
- persist_to_workspace:
14+
root: ~/
15+
paths:
16+
- opencti-client
17+
deploy:
18+
working_directory: ~/opencti-client
19+
docker:
20+
- image: circleci/python:3.6
21+
steps:
22+
- attach_workspace:
23+
at: ~/
24+
- run:
25+
name: verify git tag vs. version
26+
command: python3 setup.py verify
27+
- run:
28+
name: install twine
29+
command: pip3 install twine
30+
- run:
31+
name: init .pypirc
32+
command: |
33+
echo -e "[pypi]" >> ~/.pypirc
34+
echo -e "username = opencti" >> ~/.pypirc
35+
echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
36+
- run:
37+
name: upload to pypi
38+
command: twine upload dist/*
39+
40+
workflows:
41+
opencti_client_python:
42+
jobs:
43+
- build:
44+
filters:
45+
tags:
46+
only: /.*/
47+
- deploy:
48+
requires:
49+
- build
50+
filters:
51+
tags:
52+
only: /[0-9]+(\.[0-9]+)*/
53+
branches:
54+
ignore: /.*/
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve OpenCTI
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Please replace every line in curly brackets { like this } with an appropriate answer, and remove this line.
11+
12+
## Description
13+
14+
{ Please provide a clear and concise description of the bug. }
15+
16+
## Environment
17+
18+
1. OS (where OpenCTI server runs): { e.g. Mac OS 10, Windows 10, Ubuntu 16.4, etc. }
19+
2. OpenCTI version: { e.g. OpenCTI 1.0.2 }
20+
3. Other environment details:
21+
22+
## Reproducible Steps
23+
24+
Steps to create the smallest reproducible scenario:
25+
1. { e.g. Run ... }
26+
2. { e.g. Click ... }
27+
3. { e.g. Error ... }
28+
29+
## Expected Output
30+
31+
{ Please describe what you expected to happen. }
32+
33+
## Actual Output
34+
35+
{ Please describe what actually happened. }
36+
37+
## Additional information
38+
39+
{ Any additional information, including logs or screenshots if you have any. }
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Feature request
3+
about: Ask for a new feature to be implemented in OpenCTI
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Please replace every line in curly brackets { like this } with appropriate answers, and remove this line.
11+
12+
## Problem to Solve
13+
14+
{ Please describe the problem you would like to solve. }
15+
16+
## Current Workaround
17+
18+
{ Please describe how you currently solve or work around this problem, given OpenCTI's limitation. }
19+
20+
## Proposed Solution
21+
22+
{ Please describe the solution you would like OpenCTI to provide, to solve the problem above. }
23+
24+
## Additional Information
25+
26+
{ Any additional information, including logs or screenshots if you have any. }

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
config.yml
2+
__pycache__
3+
exports
4+
build
5+
dist
6+
pycti.egg-info
7+
logs

setup.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/python3
22
# coding: utf-8
3-
3+
import os
4+
import sys
45
from setuptools import setup
56

67
try:
@@ -10,14 +11,25 @@
1011
print("warning: pypandoc module not found, could not convert Markdown to RST")
1112
read_md = lambda f: open(f, 'r').read()
1213

14+
class VerifyVersionCommand(install):
15+
description = 'verify that the git tag matches our version'
16+
17+
def run(self):
18+
tag = os.getenv('CIRCLE_TAG')
19+
if tag != VERSION:
20+
info = "Git tag: {0} does not match the version of this app: {1}".format(
21+
tag, VERSION
22+
)
23+
sys.exit(info)
24+
1325
setup(
1426
name='pycti',
15-
version='1.0.2',
27+
version='1.0.4',
1628
description='Python API client for OpenCTI.',
17-
long_description='This is the official Python client for the OpenCTI application',
18-
author='Luatix',
29+
long_description='Official Python client for the OpenCTI platform.',
30+
author='OpenCTI',
1931
author_email='[email protected]',
20-
maintainer='Luatix',
32+
maintainer='OpenCTI',
2133
url='https://github.com/OpenCTI-Platform/client-python',
2234
license='AGPL-V3',
2335
packages=['pycti'],
@@ -35,5 +47,8 @@
3547
'Topic :: Software Development :: Libraries :: Python Modules'
3648
],
3749
include_package_data=True,
38-
install_requires=['requests']
50+
install_requires=['requests', 'PyYAML', 'python-dateutil'],
51+
cmdclass={
52+
'verify': VerifyVersionCommand,
53+
}
3954
)

0 commit comments

Comments
 (0)