Skip to content

Commit e549cf1

Browse files
authored
Build, publish and use (in containers) .deb (#1443)
1 parent 4ed19a1 commit e549cf1

File tree

9 files changed

+56
-22
lines changed

9 files changed

+56
-22
lines changed
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
steps:
22
- script: |
3-
sudo chmod a+w /opt
4-
ninja install
53
cmake -L .. 2>/dev/null | grep CMAKE_INSTALL_PREFIX: | cut -d = -f 2 > /tmp/install_prefix
4+
cpack -V -G DEB
5+
PKG=`ls *.deb`
6+
cp $PKG $(Build.ArtifactStagingDirectory)
7+
echo "##vso[task.setvariable variable=pkgname]$PKG"
68
workingDirectory: build
7-
displayName: 'Install'
9+
displayName: 'Make .deb package'
810

911
- script: |
12+
sudo apt -y install ./$(pkgname)
1013
cat /tmp/install_prefix | xargs ./test_install.sh
1114
workingDirectory: build
1215
displayName: Test installed CCF
1316

14-
- script: |
15-
INSTALL_PREFIX=`cat /tmp/install_prefix`
16-
tar czf $(Build.ArtifactStagingDirectory)/ccf.tar.gz ${INSTALL_PREFIX##/opt/}
17-
displayName: Create release tarball
18-
workingDirectory: /opt
19-
2017
- task: PublishPipelineArtifact@1
2118
inputs:
22-
path: $(Build.ArtifactStagingDirectory)/ccf.tar.gz
23-
artifact: ccf.tar.gz
19+
path: $(Build.ArtifactStagingDirectory)/$(pkgname)
20+
artifact: $(pkgname)
2421
displayName: 'Publish CCF Install'

.azure-pipelines-templates/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- task: DownloadPipelineArtifact@2
1212
inputs:
1313
source: current
14-
patterns: '**/ccf*.tar.gz'
14+
patterns: '**/ccf*.deb'
1515
path: $(Build.ArtifactStagingDirectory)
1616

1717
- task: GitHubRelease@0
@@ -21,7 +21,7 @@ jobs:
2121
action: 'create'
2222
target: '$(Build.SourceVersion)'
2323
tagSource: 'auto'
24-
assets: $(Build.ArtifactStagingDirectory)/**/ccf.tar.gz
24+
assets: $(Build.ArtifactStagingDirectory)/**/ccf*.deb
2525
assetUploadMode: 'delete'
2626
isDraft: true
2727
isPreRelease: true

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ set(ENV{BETTER_EXCEPTIONS} 1)
1717
message(STATUS "CCF version=${CCF_VERSION}")
1818
message(STATUS "CCF release version=${CCF_RELEASE_VERSION}")
1919

20+
include(${CCF_DIR}/cmake/cpack_settings.cmake)
21+
2022
# Set the default install prefix for CCF. Users may override this value with the
2123
# cmake command. For example:
2224
#

cmake/cpack_settings.cmake

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the Apache 2.0 License.
3+
4+
include(InstallRequiredSystemLibraries)
5+
set(CPACK_PACKAGE_NAME "ccf")
6+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Confidential Consortium Framework")
7+
set(CPACK_PACKAGE_CONTACT "https://github.com/Microsoft/CCF")
8+
set(CPACK_RESOURCE_FILE_LICENSE "${CCF_DIR}/LICENSE")
9+
set(CPACK_PACKAGE_VERSION ${CCF_RELEASE_VERSION})
10+
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
11+
12+
# CPack variables for Debian packages
13+
set(CPACK_DEBIAN_PACKAGE_DEPENDS
14+
"open-enclave (>=0.10.0), libuv1 (>= 1.18.0), libc++1-8, libc++abi1-8, libcurl4"
15+
)
16+
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
17+
18+
include(CPack)

getting_started/setup_vm/app-dev.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@
1414
- import_role:
1515
name: llvm_repo
1616
tasks_from: install.yml
17-
- import_role:
18-
name: ccf_run
19-
tasks_from: install.yml
2017
- import_role:
2118
name: ccf_build
2219
tasks_from: install.yml
2320
- import_role:
2421
name: ccf_install
25-
tasks_from: install.yml
22+
tasks_from: deb_install.yml

getting_started/setup_vm/app-run.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
- import_role:
1515
name: llvm_repo
1616
tasks_from: install.yml
17-
- import_role:
18-
name: ccf_run
19-
tasks_from: install.yml
2017
- import_role:
2118
name: ccf_install
22-
tasks_from: install.yml
19+
tasks_from: deb_install.yml
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
- name: Include vars
2+
include_vars: common.yml
3+
4+
- name: Install CCF
5+
apt:
6+
deb: "{{ ccf_deb_url }}"
7+
become: yes
8+
9+
- name: Copy cchost
10+
copy:
11+
src: "/opt/ccf-{{ ccf_ver }}/bin/cchost"
12+
dest: "/usr/bin/cchost"
13+
remote_src: true
14+
mode: a=rx
15+
become: true
16+
when: run_only|bool
17+
18+
- name: Remove release
19+
apt:
20+
deb: ccf
21+
state: absent
22+
become: true
23+
when: run_only|bool

getting_started/setup_vm/roles/ccf_install/vars/common.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ ccf_tarball: "ccf.tar.gz"
44
ccf_suffix: "{{ 'latest/download' if ccf_ver == 'latest' else 'download/ccf-' + ccf_ver }}"
55
ccf_url: "https://github.com/microsoft/CCF/releases/{{ ccf_suffix }}/{{ ccf_tarball }}"
66
ccf_prefix: "/opt/openenclave"
7+
ccf_deb_url: "https://github.com/microsoft/CCF/releases/{{ ccf_suffix }}/ccf_{{ ccf_ver }}_amd64.deb"

tests/test_install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ cd nested/run
1818
python3.7 -m venv env
1919
source env/bin/activate
2020
python -m pip install -U -r "$INSTALL_PREFIX"/bin/requirements.txt
21-
pip freeze > "$INSTALL_PREFIX"/bin/requirements.txt
2221

2322
# Start ephemeral network in the background
2423
network_info_file="network_info.txt"

0 commit comments

Comments
 (0)