mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
install: Introduce a script for installing Podman
Introduce a script for installing Podman in Ubuntu Focal, in environments that may, or may not, have sudo installed. Also, update our CircleCI configuration to use this script when installing Podman.
This commit is contained in:
parent
5a3a46cd46
commit
1daaafe2a3
2 changed files with 49 additions and 11 deletions
|
@ -1,6 +1,14 @@
|
|||
version: 2.1
|
||||
|
||||
aliases:
|
||||
- &provide-podman
|
||||
name: Provide Podman in Ubuntu Focal
|
||||
command: ./install/linux/install-podman-ubuntu-focal.sh --repo-only
|
||||
|
||||
- &install-podman
|
||||
name: Install Podman in Ubuntu Focal
|
||||
command: ./install/linux/install-podman-ubuntu-focal.sh
|
||||
|
||||
- &install-dependencies-deb
|
||||
name: Install dependencies (deb)
|
||||
command: |
|
||||
|
@ -121,18 +129,8 @@ jobs:
|
|||
machine:
|
||||
image: ubuntu-2004:202111-01
|
||||
steps:
|
||||
# https://www.atlantic.net/dedicated-server-hosting/how-to-install-and-use-podman-on-ubuntu-20-04/
|
||||
- run:
|
||||
name: Install podman on Ubuntu 20.04
|
||||
command: |
|
||||
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
|
||||
source /etc/os-release
|
||||
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
|
||||
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- | sudo apt-key add -
|
||||
sudo apt-get update -qq -y
|
||||
sudo apt-get -qq --yes install podman
|
||||
podman --version
|
||||
- checkout
|
||||
- run: *install-podman
|
||||
- run:
|
||||
name: Install poetry dependencies
|
||||
command: |
|
||||
|
|
40
install/linux/install-podman-ubuntu-focal.sh
Executable file
40
install/linux/install-podman-ubuntu-focal.sh
Executable file
|
@ -0,0 +1,40 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Development script for installing Podman on Ubuntu Focal. Mainly to be used as
|
||||
# part of our CI pipelines, where we may install Podman on environments that
|
||||
# don't have sudo.
|
||||
|
||||
set -e
|
||||
|
||||
if [[ "$EUID" -ne 0 ]]; then
|
||||
SUDO=sudo
|
||||
else
|
||||
SUDO=
|
||||
fi
|
||||
|
||||
provide() {
|
||||
$SUDO apt-get update
|
||||
$SUDO apt-get install curl wget gnupg2 -y
|
||||
source /etc/os-release
|
||||
$SUDO sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' \
|
||||
> /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
|
||||
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- \
|
||||
| $SUDO apt-key add -
|
||||
$SUDO apt-get update -qq -y
|
||||
}
|
||||
|
||||
install() {
|
||||
$SUDO apt-get -qq --yes install podman
|
||||
podman --version
|
||||
}
|
||||
|
||||
if [[ "$1" == "--repo-only" ]]; then
|
||||
provide
|
||||
elif [[ "$1" == "" ]]; then
|
||||
provide
|
||||
install
|
||||
else
|
||||
echo "Unexpected argument: $1"
|
||||
echo "Usage: $0 [--repo-only]"
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in a new issue