X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=snap%2Fsnapcraft.yaml;h=d9508524eb96040dcbf25ca3f4878f8365af716e;hb=70208ca1de7ff0e91a17d8f918d5b6044e9fa388;hp=b7d0f05c7b282180cbb7d37f3cc748dc080ae835;hpb=d30ad83d0f36691bb4a8f45579fcfc8436683770;p=osm%2Fosmclient.git diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index b7d0f05..d950852 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,20 +1,79 @@ -name: osmclient # you probably want to 'snapcraft register ' -version: '0.1' # just for humans, typically '1.2+git' or '1.3.2' -summary: A python client for osm orchestration +--- +## +# Copyright 2020 ETSI +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +## +name: osmclient +base: core18 +adopt-info: client +summary: A python client for orchestrating OSM description: | - A python client for osm orchestration + A python client for orchestrating Open Source Mano (OSM). -grade: stable # must be 'stable' to release into candidate/stable channels -confinement: strict # use 'strict' once you have the right plugs and slots +grade: stable + +confinement: strict + +environment: + LC_ALL: C.UTF-8 + LANG: C.UTF-8 apps: - osmclient: - command: bin/osm + osm: + command: usr/bin/python3 $SNAP/usr/local/bin/osm + plugs: + - network + - home + - ssh-public-keys + environment: + PATH: $SNAP/usr/bin:$SNAP/bin/:$PATH:$SNAP/usr/local/bin/ + PYTHONPATH: $SNAP/usr/lib/python3/dist-packages:$PYTHONPATH + MAGIC: $SNAP/usr/share/file/magic.mgc parts: - osmclient: + client: + plugin: dump source: . - plugin: python - python-version: python2 - stage: - - -README.md + build-environment: + - PATH: "$PATH:$SNAPCRAFT_PART_INSTALL/usr/local/bin" + build-packages: + - gcc + - git + - make + - wget + - libcurl4-openssl-dev + - libssl-dev + stage-packages: + - libmagic1 + - python3 + - python3-dev + - python3-pip + - python3-pycurl + - python3-setuptools + override-build: | + $SNAPCRAFT_PART_INSTALL/usr/bin/pip3 install wheel + $SNAPCRAFT_PART_INSTALL/usr/bin/pip3 install pyang + $SNAPCRAFT_PART_INSTALL/usr/bin/pip3 install pyangbind + PATH="$PATH:$SNAPCRAFT_PART_INSTALL/usr/local/bin" + BRANCH_OR_TAG=`git symbolic-ref -q --short HEAD || git describe --tags --exact-match 2>/dev/null || echo $BRANCH` + git clone https://osm.etsi.org/gerrit/osm/IM.git + cd IM/ + git checkout $BRANCH_OR_TAG + $SNAPCRAFT_PART_INSTALL/usr/bin/pip3 install . + cd ../ && rm -rf IM/ + $SNAPCRAFT_PART_INSTALL/usr/bin/pip3 install -r requirements.txt + $SNAPCRAFT_PART_INSTALL/usr/bin/pip3 install . + rm -rf .tox + snapcraftctl set-version $(git describe --match v* --tags --long --dirty) + snapcraftctl build