Build, publish and use (in containers) .deb (#1443)

This commit is contained in:
Amaury Chamayou 2020-07-31 11:46:52 +01:00 коммит произвёл GitHub
Родитель 4ed19a12ec
Коммит e549cf144f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
9 изменённых файлов: 56 добавлений и 22 удалений

Просмотреть файл

@ -1,24 +1,21 @@
steps:
- script: |
sudo chmod a+w /opt
ninja install
cmake -L .. 2>/dev/null | grep CMAKE_INSTALL_PREFIX: | cut -d = -f 2 > /tmp/install_prefix
cpack -V -G DEB
PKG=`ls *.deb`
cp $PKG $(Build.ArtifactStagingDirectory)
echo "##vso[task.setvariable variable=pkgname]$PKG"
workingDirectory: build
displayName: 'Install'
displayName: 'Make .deb package'
- script: |
sudo apt -y install ./$(pkgname)
cat /tmp/install_prefix | xargs ./test_install.sh
workingDirectory: build
displayName: Test installed CCF
- script: |
INSTALL_PREFIX=`cat /tmp/install_prefix`
tar czf $(Build.ArtifactStagingDirectory)/ccf.tar.gz ${INSTALL_PREFIX##/opt/}
displayName: Create release tarball
workingDirectory: /opt
- task: PublishPipelineArtifact@1
inputs:
path: $(Build.ArtifactStagingDirectory)/ccf.tar.gz
artifact: ccf.tar.gz
path: $(Build.ArtifactStagingDirectory)/$(pkgname)
artifact: $(pkgname)
displayName: 'Publish CCF Install'

Просмотреть файл

@ -11,7 +11,7 @@ jobs:
- task: DownloadPipelineArtifact@2
inputs:
source: current
patterns: '**/ccf*.tar.gz'
patterns: '**/ccf*.deb'
path: $(Build.ArtifactStagingDirectory)
- task: GitHubRelease@0
@ -21,7 +21,7 @@ jobs:
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'auto'
assets: $(Build.ArtifactStagingDirectory)/**/ccf.tar.gz
assets: $(Build.ArtifactStagingDirectory)/**/ccf*.deb
assetUploadMode: 'delete'
isDraft: true
isPreRelease: true

Просмотреть файл

@ -17,6 +17,8 @@ set(ENV{BETTER_EXCEPTIONS} 1)
message(STATUS "CCF version=${CCF_VERSION}")
message(STATUS "CCF release version=${CCF_RELEASE_VERSION}")
include(${CCF_DIR}/cmake/cpack_settings.cmake)
# Set the default install prefix for CCF. Users may override this value with the
# cmake command. For example:
#

Просмотреть файл

@ -0,0 +1,18 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_NAME "ccf")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Confidential Consortium Framework")
set(CPACK_PACKAGE_CONTACT "https://github.com/Microsoft/CCF")
set(CPACK_RESOURCE_FILE_LICENSE "${CCF_DIR}/LICENSE")
set(CPACK_PACKAGE_VERSION ${CCF_RELEASE_VERSION})
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
# CPack variables for Debian packages
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"open-enclave (>=0.10.0), libuv1 (>= 1.18.0), libc++1-8, libc++abi1-8, libcurl4"
)
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
include(CPack)

Просмотреть файл

@ -14,12 +14,9 @@
- import_role:
name: llvm_repo
tasks_from: install.yml
- import_role:
name: ccf_run
tasks_from: install.yml
- import_role:
name: ccf_build
tasks_from: install.yml
- import_role:
name: ccf_install
tasks_from: install.yml
tasks_from: deb_install.yml

Просмотреть файл

@ -14,9 +14,6 @@
- import_role:
name: llvm_repo
tasks_from: install.yml
- import_role:
name: ccf_run
tasks_from: install.yml
- import_role:
name: ccf_install
tasks_from: install.yml
tasks_from: deb_install.yml

Просмотреть файл

@ -0,0 +1,23 @@
- name: Include vars
include_vars: common.yml
- name: Install CCF
apt:
deb: "{{ ccf_deb_url }}"
become: yes
- name: Copy cchost
copy:
src: "/opt/ccf-{{ ccf_ver }}/bin/cchost"
dest: "/usr/bin/cchost"
remote_src: true
mode: a=rx
become: true
when: run_only|bool
- name: Remove release
apt:
deb: ccf
state: absent
become: true
when: run_only|bool

Просмотреть файл

@ -4,3 +4,4 @@ ccf_tarball: "ccf.tar.gz"
ccf_suffix: "{{ 'latest/download' if ccf_ver == 'latest' else 'download/ccf-' + ccf_ver }}"
ccf_url: "https://github.com/microsoft/CCF/releases/{{ ccf_suffix }}/{{ ccf_tarball }}"
ccf_prefix: "/opt/openenclave"
ccf_deb_url: "https://github.com/microsoft/CCF/releases/{{ ccf_suffix }}/ccf_{{ ccf_ver }}_amd64.deb"

Просмотреть файл

@ -18,7 +18,6 @@ cd nested/run
python3.7 -m venv env
source env/bin/activate
python -m pip install -U -r "$INSTALL_PREFIX"/bin/requirements.txt
pip freeze > "$INSTALL_PREFIX"/bin/requirements.txt
# Start ephemeral network in the background
network_info_file="network_info.txt"