Refactor build-ubuntu-impish to use aliases, and define separate deploy-ubuntu-impish

This commit is contained in:
Micah Lee 2021-11-24 11:36:16 -08:00
parent 92012c3699
commit 57ff5deac8
No known key found for this signature in database
GPG key ID: 403C2657CD994F73

View file

@ -1,5 +1,45 @@
version: 2.1
aliases:
- &install-dependencies-deb
name: Install dependencies (deb)
command: |
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
apt-get update
apt-get install -y git ssh ruby-dev rubygems podman python-all dh-python python3 python3-stdeb python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qtwidgets python3-appdirs python3-click python3-xdg python3-requests python3-colorama
gem install -N rake
gem install -N package_cloud
- &build-deb
name: Build the .deb package
command: |
./install/linux/build-deb.py
dpkg -i deb_dist/dangerzone_*-1_all.deb
- &restore-cache
key: v1-{{ .Revision }}
paths:
- /caches/dangerzone-converter.tar.gz
- /caches/image-id.txt
- &copy-image
name: Copy container image into package
command: |
cp /caches/dangerzone-converter.tar.gz share/
cp /caches/image-id.txt share/
- &deploy-packagecloud
name: Deploy to packagecloud.io
command: |
VERSION=$(cat share/version.txt)
if [[ "${PACKAGE_TYPE}" == "deb" ]]; then
package_cloud push firstlookmedia/code/${PACKAGECLOUD_DISTO} deb_dist/dangerzone_${VERSION}-1_all.deb
package_cloud push firstlookmedia/code/${PACKAGECLOUD_DISTO} deb_dist/dangerzone_${VERSION}-1.dsc
elif [[ "${PACKAGE_TYPE}" == "rpm" ]]; then
package_cloud push firstlookmedia/code/${PACKAGECLOUD_DISTO} dist/dangerzone-${VERSION}-1.noarch.rpm
package_cloud push firstlookmedia/code/${PACKAGECLOUD_DISTO} dist/dangerzone-${VERSION}-1.src.rpm
fi
jobs:
build-container-image:
working_directory: /app
@ -29,36 +69,26 @@ jobs:
docker:
- image: ubuntu:21.10
steps:
- run:
name: Install dependencies
command: |
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
apt-get update
apt-get install -y git ssh ruby-dev rubygems podman python-all dh-python python3 python3-stdeb python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qtwidgets python3-appdirs python3-click python3-xdg python3-requests python3-colorama
gem install -N rake
gem install -N package_cloud
- run: *install-dependencies-deb
- checkout
- restore_cache:
key: v1-{{ .Revision }}
paths:
- /caches/dangerzone-converter.tar.gz
- /caches/image-id.txt
- restore_cache: *restore-cache
- run: *copy-image
- run: *build-deb
deploy-ubuntu-impish:
docker:
- image: ubuntu:21.10
steps:
- run: *install-dependencies-deb
- checkout
- restore_cache: *restore-cache
- run: *copy-image
- run: *build-deb
- run:
name: Copy container image into package
command: |
cp /caches/dangerzone-converter.tar.gz share/
cp /caches/image-id.txt share/
- run:
name: Create the .deb package
command: |
./install/linux/build-deb.py
dpkg -i deb_dist/dangerzone_*-1_all.deb
- run:
name: Deploy to packagecloud.io
command: |
VERSION=$(cat share/version.txt)
package_cloud push firstlookmedia/code/ubuntu/impish deb_dist/dangerzone_${VERSION}-1_all.deb
package_cloud push firstlookmedia/code/ubuntu/impish deb_dist/dangerzone_${VERSION}-1.dsc
environment:
PACKAGE_TYPE: "deb"
PACKAGECLOUD_DISTRO: "ubuntu/impish"
<<: *deploy-packagecloud
build-ubuntu-hirsute:
docker:
@ -219,8 +249,6 @@ workflows:
jobs:
- build-container-image
- build-ubuntu-impish:
environment:
SKIP_DEPLOY: 1
requires:
- build-container-image