This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
-
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
35c4ef0
commit 4222b07
Showing
47 changed files
with
3,413 additions
and
975 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
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
Submodule acid
updated
3 files
+1 −0 | agents/awsEc2/agent.tf | |
+6 −0 | agents/start.yml | |
+3 −0 | agents/stop.yml |
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,247 @@ | ||
--- | ||
name: Health Test - Compile, test and package | ||
|
||
trigger: none | ||
schedules: | ||
# Run tests on master branche weekly on Sundays, including packages build on all OS | ||
- cron: "0 0 * * 0" | ||
displayName: Weekly master build | ||
branches: | ||
include: | ||
- master | ||
always: true | ||
# Run tests on dev branche weekly on Saturdays, including packages build on all OS | ||
- cron: "0 0 * * 6" | ||
displayName: Weekly dev build | ||
branches: | ||
include: | ||
- dev | ||
always: true | ||
pr: none | ||
|
||
resources: | ||
repositories: | ||
- repository: acid | ||
type: github | ||
name: Accelize/acid | ||
endpoint: Accelize | ||
|
||
pool: | ||
vmImage: ubuntu-latest | ||
|
||
variables: | ||
# Import variable group | ||
- group: drmLibrary | ||
|
||
# Allow import of python files in "deployment" dir | ||
- name: pythonPath | ||
value: $(Build.SourcesDirectory)/deployment | ||
|
||
# Common commands shortcut | ||
- name: pipInstall | ||
value: pip install --disable-pip-version-check | ||
- name: aptInstall | ||
value: sudo apt-get update && | ||
sudo apt-get install -y --no-install-recommends | ||
|
||
stages: | ||
- stage: compile_and_test | ||
displayName: Compile sources and test on hardware | ||
variables: | ||
# Set Git branch conditional variables | ||
${{ if eq(variables['Build.SourceBranch'], 'refs/heads/master') }}: | ||
meteringServer: prod | ||
${{ if ne(variables['Build.SourceBranch'], 'refs/heads/master') }}: | ||
meteringServer: dev | ||
|
||
jobs: | ||
- template: runTestOnEc2.yml | ||
parameters: | ||
instance_type: 'f1.4xlarge' | ||
config_list: | ||
- os_distrib: 'centos_7' | ||
tox_mode: 'debug' | ||
tox_coverage: false | ||
- os_distrib: 'ubuntu_18_04' | ||
tox_mode: 'debug' | ||
tox_coverage: false | ||
dependsOn: 'centos_7' | ||
|
||
- stage: create_packages | ||
displayName: Create packages | ||
# Build packages only if tagged or scheduled | ||
dependsOn: compile_and_test | ||
condition: succeededOrFailed() | ||
variables: | ||
# File that store release number for each version | ||
versionsJson: versions.json | ||
versionsJsonS3: s3://accelize/versions.json | ||
|
||
jobs: | ||
- job: buildPackages | ||
displayName: Build Packages for | ||
strategy: | ||
matrix: | ||
# Supported OS matrix | ||
CentOS 7: | ||
osName: centos | ||
osVersion: "7" | ||
CentOS 8: | ||
osName: centos | ||
osVersion: "8" | ||
Debian 10: | ||
osName: debian | ||
osVersion: "10" | ||
Fedora 32: | ||
osName: fedora | ||
osVersion: "32" | ||
Fedora 33: | ||
osName: fedora | ||
osVersion: "33" | ||
Ubuntu LTS 16.04: | ||
osName: ubuntu | ||
osVersion: "16.04" | ||
Ubuntu LTS 18.04: | ||
osName: ubuntu | ||
osVersion: "18.04" | ||
Ubuntu LTS 20.04: | ||
osName: ubuntu | ||
osVersion: "20.04" | ||
Ubuntu 20.10: | ||
osName: ubuntu | ||
osVersion: "20.10" | ||
|
||
variables: | ||
# Docker commands shortcuts | ||
dockerBuild: sudo docker build -t run_image . | ||
dockerRun: sudo -E docker run --rm | ||
--env GPG_PASS_PHRASE | ||
--env GPG_PRIVATE_KEY | ||
--env GPG_PUBLIC_KEY | ||
--env PACKAGES_RELEASE | ||
-v $(Build.SourcesDirectory):/opt | ||
-v $(Agent.TempDirectory):$(Agent.TempDirectory) | ||
-w /opt run_image bash -c | ||
steps: | ||
|
||
# Initialize environment | ||
- checkout: self | ||
submodules: true | ||
|
||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '3.x' | ||
addToPath: true | ||
architecture: 'x64' | ||
displayName: Get Python | ||
|
||
# Get package release, and increment it if an already published | ||
# version is re-build | ||
- task: AWSCLI@1 | ||
displayName: Get published releases manifest | ||
inputs: | ||
awsCredentials: AWS-Repository | ||
regionName: eu-west-1 | ||
awsCommand: s3 | ||
awsSubCommand: cp | ||
awsArguments: $(versionsJsonS3) $(versionsJson) --no-progress | ||
|
||
- task: PythonScript@0 | ||
displayName: Get package release | ||
inputs: | ||
scriptSource: inline | ||
script: | | ||
from acid import export | ||
from acid_drm import get_next_package_release | ||
export("release", get_next_package_release("versions.json")) | ||
name: packagesRelease | ||
|
||
# Build & sign packages | ||
- task: PythonScript@0 | ||
displayName: Create "building" container Dockerfile | ||
inputs: | ||
scriptSource: inline | ||
script: | | ||
from acid import render_template | ||
render_template( | ||
src='$(Build.SourcesDirectory)/deployment/Dockerfile.j2', | ||
dst='$(Build.SourcesDirectory)/Dockerfile', | ||
osName='$(osName)', osVersion='$(osVersion)', | ||
image='$(osName):$(osVersion)', buildLayer=True) | ||
- script: $(dockerBuild) | ||
displayName: Build "building" container image | ||
|
||
- task: DownloadSecureFile@1 | ||
displayName: Get GPG public key | ||
name: gpgPublicKey | ||
inputs: | ||
secureFile: gpgPublicKey | ||
|
||
- task: DownloadSecureFile@1 | ||
displayName: Get GPG private key | ||
name: gpgPrivateKey | ||
inputs: | ||
secureFile: gpgPrivateKey | ||
|
||
- script: $(dockerRun) "tox --workdir /tmp -o | ||
-e build-release,sign-release,export-release" | ||
displayName: Build and sign packages | ||
env: | ||
PACKAGES_RELEASE: $(packagesRelease.release) | ||
GPG_PRIVATE_KEY: $(gpgPrivateKey.secureFilePath) | ||
GPG_PUBLIC_KEY: $(gpgPublicKey.secureFilePath) | ||
GPG_PASS_PHRASE: $(gpgPassPhrase) | ||
|
||
# Run packages integrity tests | ||
- task: PythonScript@0 | ||
displayName: Create "testing" container Dockerfile | ||
inputs: | ||
scriptSource: inline | ||
script: | | ||
from acid import render_template | ||
render_template( | ||
src='$(Build.SourcesDirectory)/deployment/Dockerfile.j2', | ||
dst='$(Build.SourcesDirectory)/Dockerfile', | ||
osName='$(osName)', osVersion='$(osVersion)', | ||
image='$(osName):$(osVersion)', buildLayer=False) | ||
- script: $(dockerBuild) | ||
displayName: Build "testing" container image | ||
|
||
- script: $(dockerRun) "tox --workdir /tmp | ||
-e package-install,c-install,cpp-install -p all | ||
-- -m packages" | ||
displayName: Run tests on package | ||
|
||
# Run extra RHEL integrity tests for CentOS packages | ||
- task: PythonScript@0 | ||
displayName: Create "RHEL testing" container Dockerfile | ||
inputs: | ||
scriptSource: inline | ||
script: | | ||
from acid import render_template | ||
render_template( | ||
src='$(Build.SourcesDirectory)/deployment/Dockerfile.j2', | ||
dst='$(Build.SourcesDirectory)/Dockerfile', | ||
osName='rhel', osVersion='$(osVersion)', | ||
image='registry.access.redhat.com/ubi$(osVersion)', | ||
rhelUsername='$(rhelUsername)', | ||
rhelPassword='$(rhelPassword)', | ||
buildLayer=False) | ||
condition: eq(variables['osName'], 'centos') | ||
|
||
- script: $(dockerBuild) | ||
displayName: Build "RHEL testing" container image | ||
condition: eq(variables['osName'], 'centos') | ||
|
||
- script: $(dockerRun) "tox --workdir /tmp | ||
-e package-install,c-install,cpp-install -p all | ||
-- -m packages" | ||
displayName: Run RHEL tests on packages | ||
condition: eq(variables['osName'], 'centos') | ||
|
||
# Export packages as artifacts | ||
- publish: $(Build.SourcesDirectory)/packages | ||
artifact: Packages $(osName) $(osVersion) | ||
displayName: Publish packages as artifacts |
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,38 @@ | ||
--- | ||
name: DRM Library - Health Test - Install and test packages | ||
|
||
trigger: none | ||
schedules: | ||
# Run tests from Production package daily | ||
- cron: "0 0 * * *" | ||
displayName: Daily midnight test of Production packages | ||
branches: | ||
include: | ||
- master | ||
always: true | ||
pr: none | ||
|
||
resources: | ||
repositories: | ||
- repository: acid | ||
type: github | ||
name: Accelize/acid | ||
endpoint: Accelize | ||
|
||
pool: | ||
vmImage: ubuntu-latest | ||
|
||
variables: | ||
# Import variable group | ||
- group: drmLibrary | ||
|
||
jobs: | ||
- template: runTestFromPkgOnEc2.yml | ||
parameters: | ||
instance_type: 'f1.4xlarge' | ||
config_list: | ||
- os_distrib: 'centos_7' | ||
tox_extra_option: '-m minimum' | ||
- os_distrib: 'ubuntu_18_04' | ||
tox_extra_option: '-m minimum' | ||
dependsOn: 'centos_7' |
Oops, something went wrong.