mirror of
https://github.com/YunoHost/yunohost-ci.git
synced 2024-09-03 20:05:53 +02:00
Buster is now the supported version
This commit is contained in:
parent
9c14394744
commit
7f55c27283
4 changed files with 28 additions and 43 deletions
|
@ -3,7 +3,7 @@
|
||||||
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
source $current_dir/utils.sh # Get utils functions.
|
source $current_dir/utils.sh # Get utils functions.
|
||||||
|
|
||||||
for debian_version in "stretch" "buster"
|
for debian_version in "buster"
|
||||||
do
|
do
|
||||||
for ynh_version in "stable" "testing" "unstable"
|
for ynh_version in "stable" "testing" "unstable"
|
||||||
do
|
do
|
||||||
|
|
|
@ -3,41 +3,34 @@
|
||||||
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
source $current_dir/utils.sh # Get utils functions.
|
source $current_dir/utils.sh # Get utils functions.
|
||||||
|
|
||||||
for debian_version in "stretch" "buster"
|
for debian_version in "buster"
|
||||||
do
|
do
|
||||||
|
rebuild_base_containers $debian_version "stable" "amd64"
|
||||||
|
|
||||||
# There is no stable and testing version for Buster at this time.
|
for ynh_version in "testing" "unstable"
|
||||||
if [[ "$debian_version" == "buster" ]]
|
do
|
||||||
then
|
for snapshot in "before-install" "after-install"
|
||||||
rebuild_base_containers $debian_version "unstable" "amd64"
|
|
||||||
else
|
|
||||||
rebuild_base_containers $debian_version "stable" "amd64"
|
|
||||||
|
|
||||||
for ynh_version in "testing" "unstable"
|
|
||||||
do
|
do
|
||||||
for snapshot in "before-install" "after-install"
|
lxc launch "yunohost-$debian_version-stable-$snapshot" "yunohost-$debian_version-$ynh_version-$snapshot-tmp"
|
||||||
do
|
|
||||||
lxc launch "yunohost-$debian_version-stable-$snapshot" "yunohost-$debian_version-$ynh_version-$snapshot-tmp"
|
|
||||||
|
|
||||||
if [[ "$ynh_version" == "testing" ]]
|
if [[ "$ynh_version" == "testing" ]]
|
||||||
then
|
then
|
||||||
repo_version="testing"
|
repo_version="testing"
|
||||||
elif [[ "$DISTRIB" == "unstable" ]]
|
elif [[ "$DISTRIB" == "unstable" ]]
|
||||||
then
|
then
|
||||||
repo_version="testing unstable"
|
repo_version="testing unstable"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
lxc exec "yunohost-$debian_version-$ynh_version-$snapshot-tmp" -- /bin/bash -c "for FILE in \`ls /etc/apt/sources.list /etc/apt/sources.list.d/*\`;
|
lxc exec "yunohost-$debian_version-$ynh_version-$snapshot-tmp" -- /bin/bash -c "for FILE in \`ls /etc/apt/sources.list /etc/apt/sources.list.d/*\`;
|
||||||
do
|
do
|
||||||
sed -i 's@^deb http://forge.yunohost.org.*@& $repo_version@' \$FILE
|
sed -i 's@^deb http://forge.yunohost.org.*@& $repo_version@' \$FILE
|
||||||
done"
|
done"
|
||||||
|
|
||||||
rotate_image "yunohost-$debian_version-$ynh_version-$snapshot-tmp" "yunohost-$debian_version-$ynh_version-$snapshot"
|
rotate_image "yunohost-$debian_version-$ynh_version-$snapshot-tmp" "yunohost-$debian_version-$ynh_version-$snapshot"
|
||||||
|
|
||||||
lxc delete -f "yunohost-$debian_version-$ynh_version-$snapshot-tmp"
|
lxc delete -f "yunohost-$debian_version-$ynh_version-$snapshot-tmp"
|
||||||
|
|
||||||
update_image $debian_version $ynh_version $snapshot
|
update_image $debian_version $ynh_version $snapshot
|
||||||
done
|
|
||||||
done
|
done
|
||||||
fi
|
done
|
||||||
done
|
done
|
12
utils.sh
12
utils.sh
|
@ -162,10 +162,7 @@ rebuild_base_containers()
|
||||||
|
|
||||||
wait_container "$base_image_to_rebuild-tmp"
|
wait_container "$base_image_to_rebuild-tmp"
|
||||||
|
|
||||||
if [[ "$debian_version" == "buster" ]]
|
lxc config set "$base_image_to_rebuild-tmp" security.nesting true # Need this for buster because it is using apparmor
|
||||||
then
|
|
||||||
lxc config set "$base_image_to_rebuild-tmp" security.nesting true # Need this for buster because it is using apparmor
|
|
||||||
fi
|
|
||||||
|
|
||||||
lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "apt-get update"
|
lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "apt-get update"
|
||||||
lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "apt-get install --assume-yes wget curl"
|
lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "apt-get install --assume-yes wget curl"
|
||||||
|
@ -176,12 +173,7 @@ rebuild_base_containers()
|
||||||
lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "curl -s https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | bash"
|
lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "curl -s https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | bash"
|
||||||
lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "apt-get install --assume-yes gitlab-runner"
|
lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "apt-get install --assume-yes gitlab-runner"
|
||||||
|
|
||||||
if [[ "$debian_version" == "buster" ]]
|
INSTALL_SCRIPT="https://install.yunohost.org"
|
||||||
then
|
|
||||||
INSTALL_SCRIPT="https://raw.githubusercontent.com/YunoHost/install_script/buster-unstable/install_yunohost"
|
|
||||||
else
|
|
||||||
INSTALL_SCRIPT="https://install.yunohost.org"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Download the YunoHost install script
|
# Download the YunoHost install script
|
||||||
lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "curl $INSTALL_SCRIPT > install.sh"
|
lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "curl $INSTALL_SCRIPT > install.sh"
|
||||||
|
|
|
@ -8,12 +8,12 @@ source $current_dir/prints.sh # Get variables from variables.
|
||||||
CONTAINER_ID="runner-$CUSTOM_ENV_CI_RUNNER_ID-project-$CUSTOM_ENV_CI_PROJECT_ID-concurrent-$CUSTOM_ENV_CI_CONCURRENT_PROJECT_ID-$CUSTOM_ENV_CI_JOB_ID"
|
CONTAINER_ID="runner-$CUSTOM_ENV_CI_RUNNER_ID-project-$CUSTOM_ENV_CI_PROJECT_ID-concurrent-$CUSTOM_ENV_CI_CONCURRENT_PROJECT_ID-$CUSTOM_ENV_CI_JOB_ID"
|
||||||
ARCH="$(echo $CUSTOM_ENV_CI_RUNNER_EXECUTABLE_ARCH | cut -d'/' -f2)" # linux/amd64
|
ARCH="$(echo $CUSTOM_ENV_CI_RUNNER_EXECUTABLE_ARCH | cut -d'/' -f2)" # linux/amd64
|
||||||
DEFAULT_BRANCH="$CUSTOM_ENV_CI_DEFAULT_BRANCH"
|
DEFAULT_BRANCH="$CUSTOM_ENV_CI_DEFAULT_BRANCH"
|
||||||
CURRENT_VERSION=$(echo $CUSTOM_ENV_CI_DEFAULT_BRANCH | cut -d'-' -f2) # stretch-unstable, stretch-testing, stretch-stable...
|
CURRENT_VERSION=$(echo $CUSTOM_ENV_CI_DEFAULT_BRANCH | cut -d'-' -f2) # buster-unstable, buster-testing, buster-stable...
|
||||||
CURRENT_BRANCH="$CUSTOM_ENV_CI_COMMIT_REF_NAME"
|
CURRENT_BRANCH="$CUSTOM_ENV_CI_COMMIT_REF_NAME"
|
||||||
DEBIAN_VERSION=$(echo $CUSTOM_ENV_CI_COMMIT_REF_NAME | cut -d'-' -f1) # CUSTOM_ENV_CI_COMMIT_REF_NAME is the target branch of the MR: stretch-unstable, buster-unstable...
|
DEBIAN_VERSION=$(echo $CUSTOM_ENV_CI_COMMIT_REF_NAME | cut -d'-' -f1) # CUSTOM_ENV_CI_COMMIT_REF_NAME is the target branch of the MR: stretch-unstable, buster-unstable...
|
||||||
if [ -z "$DEBIAN_VERSION" ] || [ "$DEBIAN_VERSION" != "stretch" ] && [ "$DEBIAN_VERSION" != "buster" ]
|
if [ -z "$DEBIAN_VERSION" ] || [ "$DEBIAN_VERSION" != "buster" ]
|
||||||
then
|
then
|
||||||
DEBIAN_VERSION="$(echo $CUSTOM_ENV_CI_DEFAULT_BRANCH | cut -d'-' -f1)" # stretch-unstable, buster-unstable...
|
DEBIAN_VERSION="$(echo $CUSTOM_ENV_CI_DEFAULT_BRANCH | cut -d'-' -f1)" # buster-unstable
|
||||||
info "Use the default debian version: $DEBIAN_VERSION"
|
info "Use the default debian version: $DEBIAN_VERSION"
|
||||||
fi
|
fi
|
||||||
SNAPSHOT_NAME="$CUSTOM_ENV_CI_JOB_IMAGE"
|
SNAPSHOT_NAME="$CUSTOM_ENV_CI_JOB_IMAGE"
|
||||||
|
@ -24,5 +24,5 @@ fi
|
||||||
PROJECT_DIR="$CUSTOM_ENV_CI_PROJECT_DIR"
|
PROJECT_DIR="$CUSTOM_ENV_CI_PROJECT_DIR"
|
||||||
PROJECT_NAME="$CUSTOM_ENV_CI_PROJECT_NAME"
|
PROJECT_NAME="$CUSTOM_ENV_CI_PROJECT_NAME"
|
||||||
|
|
||||||
# For example yunohost-stretch-unstable
|
# For example yunohost-buster-unstable
|
||||||
BASE_IMAGE="yunohost-$DEBIAN_VERSION-$CURRENT_VERSION"
|
BASE_IMAGE="yunohost-$DEBIAN_VERSION-$CURRENT_VERSION"
|
||||||
|
|
Loading…
Reference in a new issue