-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b63083
commit 72f8a3c
Showing
4 changed files
with
138 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: build | ||
|
||
trigger: | ||
tags: | ||
include: ["v*"] | ||
|
||
pool: | ||
vmImage: 'ubuntu-18.04' | ||
|
||
stages: | ||
- stage: build | ||
jobs: | ||
- job: build_package | ||
displayName: Build Package | ||
steps: | ||
- task: UsePythonVersion@0 | ||
displayName: Set python version | ||
inputs: {versionSpec: 3.8} | ||
- script: | | ||
sudo env "PATH=$PATH" python -m pip install --no-cache-dir -U wheel cython pip | ||
python setup.py bdist_wheel | ||
- publish: $(System.DefaultWorkingDirectory)/dist/ | ||
artifact: dist | ||
- publish: $(System.DefaultWorkingDirectory)/pipelines/ | ||
artifact: pipelines | ||
- publish: $(System.DefaultWorkingDirectory)/test/ | ||
artifact: test | ||
#- stage: test | ||
# jobs: | ||
# - job: run_test | ||
# strategy: | ||
# matrix: | ||
# python3_7: | ||
# python.version: '3.7' | ||
# Python3_8: | ||
# python.version: '3.8' | ||
# timeoutInMinutes: 10 | ||
# steps: | ||
# - checkout: none | ||
# - task: UsePythonVersion@0 | ||
# displayName: Set python version | ||
# inputs: | ||
# versionSpec: '$(python.version)' | ||
# - download: current | ||
# artifact: dist | ||
# - download: current | ||
# artifact: pipelines | ||
# - download: current | ||
# artifact: test | ||
# - script: | | ||
# set -x # Echo commands before they are run | ||
# sudo apt-get update | ||
# sudo apt-get install -y build-essential libffi-dev libfuzzy-dev python3-dev | ||
# export VERSION=${BUILD_SOURCEBRANCH#"refs/tags/v"} | ||
# sudo -E env "PATH=$PATH" python -m pip install --no-cache-dir -f $(Pipeline.Workspace)/dist/ "assemblyline-service-client==${VERSION}" -r $(Pipeline.Workspace)/test/requirements.txt | ||
# sudo mkdir -p /etc/assemblyline/ | ||
# sudo mkdir -p /var/cache/assemblyline/ | ||
# sudo chmod a+rw /var/cache/assemblyline/ | ||
# sudo cp $(Pipeline.Workspace)/pipelines/config.yml /etc/assemblyline | ||
# displayName: Install package | ||
# - script: pytest -rsx -vv | ||
# workingDirectory: $(Pipeline.Workspace)/test | ||
# displayName: Test | ||
- stage: deploy | ||
jobs: | ||
- job: deploy | ||
displayName: Deploy packages and containers | ||
variables: | ||
- group: deployment-information | ||
steps: | ||
- download: current | ||
artifact: dist | ||
- script: | | ||
set -xv # Echo commands before they are run | ||
sudo env "PATH=$PATH" python -m pip install --no-cache-dir twine | ||
ls dist | ||
twine upload --skip-existing --repository-url $TEST_REPOSITORY_URL dist/* | ||
workingDirectory: $(Pipeline.Workspace) | ||
displayName: Deploy to Test PyPI | ||
env: | ||
TWINE_USERNAME: $(twineUsername) | ||
TWINE_PASSWORD: $(twinePassword) | ||
- script: | | ||
set -xv # Echo commands before they are run | ||
sudo env "PATH=$PATH" python -m pip install --no-cache-dir twine | ||
ls dist | ||
twine upload --skip-existing dist/* | ||
workingDirectory: $(Pipeline.Workspace) | ||
displayName: Deploy to PyPI | ||
env: | ||
TWINE_USERNAME: $(twineUsername) | ||
TWINE_PASSWORD: $(twinePassword) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: tests | ||
|
||
trigger: ["*"] | ||
pr: ["*"] | ||
|
||
pool: | ||
vmImage: 'ubuntu-18.04' | ||
|
||
jobs: | ||
- job: run_test | ||
strategy: | ||
matrix: | ||
python3_7: | ||
python.version: '3.7' | ||
Python3_8: | ||
python.version: '3.8' | ||
|
||
timeoutInMinutes: 10 | ||
|
||
steps: | ||
- task: UsePythonVersion@0 | ||
displayName: Set python version | ||
inputs: | ||
versionSpec: '$(python.version)' | ||
- script: | | ||
sudo mkdir -p /etc/assemblyline/ | ||
sudo mkdir -p /var/cache/assemblyline/ | ||
sudo cp pipelines/config.yml /etc/assemblyline | ||
sudo chmod a+rw /var/cache/assemblyline/ | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential libffi-dev libfuzzy-dev python3-dev | ||
sudo env "PATH=$PATH" python -m pip install --no-cache-dir -U pip cython setuptools | ||
sudo env "PATH=$PATH" python -m pip install --no-cache-dir -e . | ||
sudo env "PATH=$PATH" python -m pip install --no-cache-dir -r test/requirements.txt | ||
displayName: Setup environment | ||
- script: python -m pytest -rsx -vv | ||
displayName: Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
logging: | ||
log_to_console: false | ||
log_to_file: false | ||
log_to_syslog: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters