mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-19 09:51:29 +00:00
cleanup: remove redundant files
And use top level VERSION for all components. Fixes: #334 Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
parent
3bbb97add3
commit
a1ef594d2a
@ -1,25 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export tests_repo="${tests_repo:-github.com/kata-containers/tests}"
|
||||
export tests_repo_dir="$GOPATH/src/$tests_repo"
|
||||
|
||||
clone_tests_repo()
|
||||
{
|
||||
# KATA_CI_NO_NETWORK is (has to be) ignored if there is
|
||||
# no existing clone.
|
||||
if [ -d "$tests_repo_dir" -a -n "$KATA_CI_NO_NETWORK" ]
|
||||
then
|
||||
return
|
||||
fi
|
||||
|
||||
go get -d -u "$tests_repo" || true
|
||||
}
|
||||
|
||||
run_static_checks()
|
||||
{
|
||||
clone_tests_repo
|
||||
bash "$tests_repo_dir/.ci/static-checks.sh" "github.com/kata-containers/documentation"
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
cidir=$(dirname "$0")
|
||||
bash "${cidir}/test-install-docs.sh"
|
@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
cidir=$(dirname "$0")
|
||||
source "${cidir}/lib.sh"
|
||||
|
||||
clone_tests_repo
|
||||
|
||||
pushd "${tests_repo_dir}"
|
||||
.ci/setup.sh
|
||||
popd
|
@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -e
|
||||
|
||||
cidir=$(dirname "$0")
|
||||
source "${cidir}/lib.sh"
|
||||
|
||||
run_static_checks
|
@ -1,351 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -e
|
||||
|
||||
# The go binary isn't installed, but we checkout the repos to the standard
|
||||
# golang locations.
|
||||
export GOPATH=${GOPATH:-${HOME}/go}
|
||||
|
||||
typeset -r script_name="${0##*/}"
|
||||
typeset -r script_dir="$(cd "$(dirname "${0}")" && pwd)"
|
||||
|
||||
typeset -r docker_image="busybox"
|
||||
typeset -r kata_project_url="github.com/kata-containers"
|
||||
typeset -r test_repo="${kata_project_url}/tests"
|
||||
typeset -r test_repo_url="https://${test_repo}"
|
||||
typeset -r test_repo_dir="${GOPATH}/src/${test_repo}"
|
||||
typeset -r kata_project_dir="${GOPATH}/src/${kata_project_url}"
|
||||
|
||||
typeset -r mgr="${test_repo_dir}/cmd/kata-manager/kata-manager.sh"
|
||||
typeset -r doc_to_script="${test_repo_dir}/.ci/kata-doc-to-script.sh"
|
||||
|
||||
die()
|
||||
{
|
||||
local msg="$*"
|
||||
echo >&2 "ERROR: $msg"
|
||||
exit 1
|
||||
}
|
||||
|
||||
info()
|
||||
{
|
||||
local msg="$*"
|
||||
echo "INFO: $msg"
|
||||
}
|
||||
|
||||
usage()
|
||||
{
|
||||
cat <<EOT
|
||||
Description: Run Kata documentation CI tests.
|
||||
|
||||
Usage: $script_name [options]
|
||||
|
||||
Options:
|
||||
|
||||
-h : Show this help.
|
||||
-t <dir> : Run all scripts ("\*.sh" files) in the specified
|
||||
directory.
|
||||
|
||||
Notes:
|
||||
- The '-t' option is not generally useful - it is used by this
|
||||
script which re-exec's itself with this option.
|
||||
|
||||
EOT
|
||||
}
|
||||
|
||||
# Re-execute the running script from a temporary directory to allow the
|
||||
# script to continue executing even if the original source file is deleted.
|
||||
reexec_in_tmpdir()
|
||||
{
|
||||
local -r test_dir="$1"
|
||||
|
||||
[ -d "${test_dir}" ] || die "invalid test dir: ${test_dir}"
|
||||
|
||||
if [ "${script_dir}" = "${test_dir}" ]
|
||||
then
|
||||
# Already running from temp directory so nothing else to do
|
||||
return
|
||||
fi
|
||||
|
||||
local new
|
||||
new="${test_dir}/${script_name}"
|
||||
|
||||
install --mode 750 "${0}" "${new}"
|
||||
|
||||
info "Re-execing ${0} as ${new}"
|
||||
|
||||
cd "${test_dir}"
|
||||
|
||||
exec "${new}" -t "${test_dir}/tests"
|
||||
}
|
||||
|
||||
# Grab a copy of the tests repository
|
||||
get_tests_repo()
|
||||
{
|
||||
[ -d "${test_repo_dir}" ] && return
|
||||
|
||||
mkdir -p "${kata_project_dir}"
|
||||
|
||||
git clone "${test_repo_url}" "${test_repo_dir}"
|
||||
}
|
||||
|
||||
# Delete all local github repo clones.
|
||||
#
|
||||
# This is required to ensure that the tests themselves (re-)create these
|
||||
# clones.
|
||||
delete_kata_repos()
|
||||
{
|
||||
[ -n "${KATA_DEV_MODE}" ] && die "Not continuing as this is a dev system"
|
||||
[ -z "${CI}" ] && die "Not continuing as this is a non-CI environment"
|
||||
|
||||
local cwd="$PWD"
|
||||
|
||||
info "Deleting all local kata repositories below ${kata_project_dir}"
|
||||
|
||||
[ -d "${kata_project_dir}" ] && rm -rf "${kata_project_dir}" || true
|
||||
|
||||
# Recreate the empty directory, taking care to handle the scenario
|
||||
# where the script is run from within the just-deleted directory.
|
||||
mkdir -p "$cwd" && cd "$cwd"
|
||||
}
|
||||
|
||||
setup()
|
||||
{
|
||||
source /etc/os-release || source /usr/lib/os-release
|
||||
|
||||
mkdir -p "${GOPATH}"
|
||||
|
||||
get_tests_repo
|
||||
|
||||
[ -e "$mgr" ] || die "cannot find $mgr"
|
||||
}
|
||||
|
||||
# Perform a simple test to create a container
|
||||
create_kata_container()
|
||||
{
|
||||
local -r test_name="$1"
|
||||
|
||||
local -r msg=$(info "Successfully tested ${test_name} on distro ${ID} ${VERSION}")
|
||||
|
||||
# Perform a basic test
|
||||
sudo -E docker run --rm -i --runtime "kata-runtime" "${docker_image}" echo "$msg"
|
||||
}
|
||||
|
||||
# Run the kata manager to "execute" the install guide to ensure the commands
|
||||
# it specified result in a working system.
|
||||
test_distro_install_guide()
|
||||
{
|
||||
info "Installing system from the $ID install guide"
|
||||
|
||||
$mgr install-docker-system
|
||||
|
||||
$mgr configure-image
|
||||
$mgr enable-debug
|
||||
|
||||
local mgr_name="${mgr##*/}"
|
||||
|
||||
local test_name="${mgr_name} to test install guide"
|
||||
|
||||
info "Install using ${test_name}"
|
||||
|
||||
create_kata_container "${test_name}"
|
||||
|
||||
# Clean up
|
||||
$mgr remove-packages
|
||||
}
|
||||
|
||||
# Apart from the distro-specific install guides, users can choose to install
|
||||
# using one of the following methods:
|
||||
#
|
||||
# - kata-manager ("Automatic" method).
|
||||
# - kata-doc-to-script ("Scripted" method).
|
||||
#
|
||||
# Testing these is awkward because we need to "execute" the documents
|
||||
# describing those install methods, but since those install methods should
|
||||
# themselves entirely document/handle an installation method, we need to
|
||||
# convert each install document to a script, then delete all the kata code
|
||||
# repositories. This ensures that when each install method script is run, it
|
||||
# does not rely on any local files (it should download anything it needs). But
|
||||
# since we're deleting the repos, we need to copy this script to a temporary
|
||||
# location, along with the install scripts this function generates, and then
|
||||
# re-exec this script with an option to ask it to run the scripts the previous
|
||||
# instance of this script just generated.
|
||||
test_alternative_install_methods()
|
||||
{
|
||||
local -a files
|
||||
files+=("installing-with-kata-manager.md")
|
||||
files+=("installing-with-kata-doc-to-script.md")
|
||||
|
||||
local tmp_dir
|
||||
|
||||
tmp_dir=$(mktemp -d)
|
||||
|
||||
local script_file
|
||||
|
||||
local file
|
||||
|
||||
local tests_dir
|
||||
tests_dir="${tmp_dir}/tests"
|
||||
|
||||
mkdir -p "${tests_dir}"
|
||||
|
||||
local -i num=0
|
||||
|
||||
# Convert the docs to scripts
|
||||
for file in "${files[@]}"
|
||||
do
|
||||
num+=1
|
||||
|
||||
local file_path
|
||||
local script_file
|
||||
local script_file_path
|
||||
local test_name
|
||||
|
||||
file_path="${script_dir}/../install/${file}"
|
||||
script_file=${file/.md/.sh}
|
||||
|
||||
# Add a numeric prefix so the tests are run in the array order
|
||||
test_name=$(printf "%.2d-%s" "${num}" "${script_file}")
|
||||
|
||||
script_file_path="${tests_dir}/${test_name}"
|
||||
|
||||
info "Creating test script ${test_name} from ${file}"
|
||||
|
||||
bash "${doc_to_script}" "${file_path}" "${script_file_path}"
|
||||
done
|
||||
|
||||
reexec_in_tmpdir "${tmp_dir}"
|
||||
|
||||
# Not reached
|
||||
die "re-exec failed"
|
||||
}
|
||||
|
||||
run_tests()
|
||||
{
|
||||
# If docker was installed by default, zap it.
|
||||
$mgr -v -f remove-docker
|
||||
|
||||
test_distro_install_guide
|
||||
test_alternative_install_methods
|
||||
}
|
||||
|
||||
# Detect if any installation documents changed. If so, execute all the
|
||||
# documents to test they result in a working system.
|
||||
check_install_docs()
|
||||
{
|
||||
if [ -n "$TRAVIS" ]
|
||||
then
|
||||
info "Not testing install guide as Travis lacks modern distro support and VT-x"
|
||||
return
|
||||
fi
|
||||
|
||||
# List of filters used to restrict the types of file changes.
|
||||
# See git-diff-tree(1) for further info.
|
||||
local filters=""
|
||||
|
||||
# Added file
|
||||
filters+="A"
|
||||
|
||||
# Copied file
|
||||
filters+="C"
|
||||
|
||||
# Modified file
|
||||
filters+="M"
|
||||
|
||||
# Renamed file
|
||||
filters+="R"
|
||||
|
||||
# Unmerged (U) and Unknown (X) files. These particular filters
|
||||
# shouldn't be necessary but just in case...
|
||||
filters+="UX"
|
||||
|
||||
# List of changed files
|
||||
local files=$(git diff-tree \
|
||||
--name-only \
|
||||
--no-commit-id \
|
||||
--diff-filter="${filters}" \
|
||||
-r \
|
||||
origin/master HEAD || true)
|
||||
|
||||
# No files were changed
|
||||
[ -z "$files" ] && return
|
||||
|
||||
changed=$(echo "${files}" | grep "^install/.*\.md$" || true)
|
||||
|
||||
[ -z "$changed" ] && info "No install documents modified" && return
|
||||
|
||||
info "Found modified install documents: ${changed}"
|
||||
|
||||
# Regardless of which installation documents were changed, we test
|
||||
# them all where possible.
|
||||
run_tests
|
||||
}
|
||||
|
||||
# Run the test scripts in the specified directory.
|
||||
run_tests_from_dir()
|
||||
{
|
||||
local -r test_dir="$1"
|
||||
|
||||
[ -e "$test_dir" ] || die "invalid test dir: ${test_dir}"
|
||||
|
||||
cd "${test_dir}"
|
||||
|
||||
info "Looking for tests scripts to run in directory ${test_dir}"
|
||||
|
||||
for t in $(ls -- *.sh)
|
||||
do
|
||||
# Ensure the test script cannot access any local files
|
||||
# (since it should be standalone and download any files
|
||||
# it needs).
|
||||
delete_kata_repos
|
||||
|
||||
info "Running test script '$t'"
|
||||
bash -x "${t}"
|
||||
|
||||
# Ensure it is possible to use the installed system
|
||||
create_kata_container "${t}"
|
||||
|
||||
# Re-run setup to recreate the tests repo that was deleted
|
||||
# before the test ran.
|
||||
setup
|
||||
|
||||
# Packaged install so clean up
|
||||
# (Note that '$mgr' should now exist again)
|
||||
$mgr remove-packages
|
||||
done
|
||||
|
||||
# paranoia
|
||||
[ -d "${test_dir}" ] && rm -rf "${test_dir}"
|
||||
|
||||
info "All tests passed"
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
local opt
|
||||
local test_dir
|
||||
|
||||
setup
|
||||
|
||||
while getopts "ht:" opt
|
||||
do
|
||||
case "$opt" in
|
||||
h) usage; exit 0;;
|
||||
t) test_dir="$OPTARG";;
|
||||
*) die "invalid option: $opt";;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -n "$test_dir" ]
|
||||
then
|
||||
run_tests_from_dir "$test_dir"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
check_install_docs
|
||||
}
|
||||
|
||||
main "$@"
|
@ -1,25 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
sudo: required
|
||||
dist: xenial
|
||||
|
||||
language: go
|
||||
os:
|
||||
- linux
|
||||
- linux-ppc64le
|
||||
|
||||
go:
|
||||
- "1.10.x"
|
||||
|
||||
before_install:
|
||||
- ".ci/setup.sh"
|
||||
|
||||
before_script:
|
||||
- ".ci/static-checks.sh"
|
||||
|
||||
script:
|
||||
- ".ci/run.sh"
|
@ -1 +0,0 @@
|
||||
1.11.0-rc0
|
@ -1 +0,0 @@
|
||||
0.0.1
|
1
src/agent/VERSION
Symbolic link
1
src/agent/VERSION
Symbolic link
@ -0,0 +1 @@
|
||||
../../VERSION
|
@ -1 +0,0 @@
|
||||
1.11.0-rc0
|
1
src/runtime/VERSION
Symbolic link
1
src/runtime/VERSION
Symbolic link
@ -0,0 +1 @@
|
||||
../../VERSION
|
@ -1 +0,0 @@
|
||||
1.11.0-rc0
|
1
tools/osbuilder/VERSION
Symbolic link
1
tools/osbuilder/VERSION
Symbolic link
@ -0,0 +1 @@
|
||||
../../VERSION
|
@ -1,55 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2019 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
trigger:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
- job: packages
|
||||
#timeout set to max
|
||||
timeoutInMinutes: 0
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
steps:
|
||||
# azure docker installation task
|
||||
# https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/docker-installer?view=azure-devops
|
||||
- task: DockerInstaller@0
|
||||
displayName: 'Install Docker'
|
||||
|
||||
- bash: |
|
||||
sudo apt-get update -y -qq
|
||||
sudo apt-get --no-install-recommends install -y git
|
||||
git config --global user.email "azure-pipeline@kata.io"
|
||||
git config --global user.name "azure-pipeline"
|
||||
.ci/packaging/setup.sh
|
||||
displayName: 'Setup'
|
||||
env:
|
||||
CI: true
|
||||
branch: $(system.pullRequest.targetBranch)
|
||||
GITHUB_PR: $(system.pullRequest.pullRequestNumber)
|
||||
|
||||
- bash: |
|
||||
# This is set by azure, but we use the same variable
|
||||
export AGENT_VERSION=""
|
||||
script -qefc bash -c '.ci/packaging/request_to_obs.sh'
|
||||
# Kata branch to build
|
||||
displayName: 'Request build to OBS'
|
||||
|
||||
env:
|
||||
CI: true
|
||||
BRANCH: $(system.pullRequest.targetBranch)
|
||||
OBS_USER: $(OBS_USER)
|
||||
OBS_PASS: $(OBS_PASS)
|
||||
GITHUB_PR: $(system.pullRequest.pullRequestNumber)
|
||||
|
||||
- bash: |
|
||||
echo "Wait for packages from ${OBS_SUBPROJECT}"
|
||||
[ "${OBS_SUBPROJECT}" != "" ] || { echo "OBS_SUBPROJECT"; exit 1; }
|
||||
script -qefc bash -c './obs-packaging/wait-obs.sh --no-wait-publish'
|
||||
displayName: 'Wait for packages are ready'
|
||||
env:
|
||||
USE_DOCKER: true
|
||||
CI: $(CI)
|
@ -1,27 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2019 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
trigger:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
- job: packages
|
||||
#timeout set to max
|
||||
timeoutInMinutes: 0
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
steps:
|
||||
# azure docker installation task
|
||||
# https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/docker-installer?view=azure-devops
|
||||
- task: DockerInstaller@0
|
||||
displayName: 'Install Docker'
|
||||
|
||||
- bash: |
|
||||
sudo apt-get update -y -qq
|
||||
sudo apt-get --no-install-recommends install -y apt-utils ca-certificates git
|
||||
git config --global user.email "azure-pipeline@kata.io"
|
||||
git config --global user.name "azure-pipeline"
|
||||
displayName: 'Setup'
|
@ -1,34 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2018,2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export tests_repo="${tests_repo:-github.com/kata-containers/tests}"
|
||||
export tests_repo_dir="$GOPATH/src/$tests_repo"
|
||||
|
||||
clone_tests_repo()
|
||||
{
|
||||
# KATA_CI_NO_NETWORK is (has to be) ignored if there is
|
||||
# no existing clone.
|
||||
if [ -d "$tests_repo_dir" -a -n "$KATA_CI_NO_NETWORK" ]
|
||||
then
|
||||
return
|
||||
fi
|
||||
|
||||
go get -d -u "$tests_repo" || true
|
||||
if [ -n "${TRAVIS_BRANCH:-}" ]; then
|
||||
( cd "${tests_repo_dir}" && git checkout "${TRAVIS_BRANCH}" )
|
||||
fi
|
||||
}
|
||||
|
||||
run_static_checks()
|
||||
{
|
||||
clone_tests_repo
|
||||
bash "$tests_repo_dir/.ci/static-checks.sh" "github.com/kata-containers/packaging"
|
||||
}
|
||||
|
||||
run_go_test()
|
||||
{
|
||||
clone_tests_repo
|
||||
bash "$tests_repo_dir/.ci/go-test.sh"
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2019 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# This script will request package creation in OBS.
|
||||
# create a repository under:
|
||||
# https://build.opensuse.org/project/show/home:katacontainers
|
||||
# Generate package files: rpm spec, deb source files.
|
||||
# Send a request to OBS to build the packages in its servers
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
set -o errtrace
|
||||
|
||||
[ -z "${DEBUG:-}" ] || set -x
|
||||
readonly script_dir=$(dirname $(readlink -f "$0"))
|
||||
readonly packaging_dir="${script_dir}/../.."
|
||||
|
||||
# Kata branch where packages will be based
|
||||
BRANCH=${BRANCH:-master}
|
||||
|
||||
# Name of OBS branch to to push
|
||||
OBS_BRANCH="${OBS_BRANCH:-testing}"
|
||||
|
||||
if [ "${CI:-}" == "true" ] && [ "${GITHUB_PR:-}" != "" ]; then
|
||||
OBS_BRANCH="packaging-PR-${GITHUB_PR}"
|
||||
fi
|
||||
|
||||
# Push to anywhere, variable used by release scripts to push
|
||||
PUSH=1
|
||||
BUILD_HEAD=${BUILD_HEAD:-${CI:-}}
|
||||
|
||||
if [ "${CI:-}" == "true" ]; then
|
||||
SUBPROJECT_TYPE="ci"
|
||||
else
|
||||
SUBPROJECT_TYPE="releases"
|
||||
fi
|
||||
# Name of the OBS subproject under:
|
||||
# https://build.opensuse.org/project/subprojects/home:katacontainers
|
||||
OBS_SUBPROJECT="${SUBPROJECT_TYPE}:$(uname -m):${OBS_BRANCH}"
|
||||
|
||||
export BUILD_HEAD
|
||||
export BRANCH
|
||||
export OBS_BRANCH
|
||||
export OBS_SUBPROJECT
|
||||
export PUSH
|
||||
|
||||
# azure: Export in all pipeline tasks
|
||||
echo "##vso[task.setvariable variable=OBS_SUBPROJECT;]${OBS_SUBPROJECT}"
|
||||
|
||||
echo "INFO: BUILD_HEAD=${BUILD_HEAD}"
|
||||
echo "INFO: BRANCH=${BRANCH}"
|
||||
echo "INFO: OBS_BRANCH=${OBS_SUBPROJECT}"
|
||||
echo "INFO: PUSH=${PUSH}"
|
||||
echo "INFO: SUBPROJECT_TYPE=${SUBPROJECT_TYPE}"
|
||||
|
||||
# Export in all pipeline tasks
|
||||
cd "${packaging_dir}/obs-packaging" || exit 1
|
||||
gen_versions_cmd="./gen_versions_txt.sh"
|
||||
if [ "${BUILD_HEAD}" = "true" ]; then
|
||||
echo "Building for head gen versions ..."
|
||||
gen_versions_cmd+=" --head"
|
||||
fi
|
||||
|
||||
${gen_versions_cmd} "${BRANCH}"
|
||||
|
||||
# print versions just for debug/info
|
||||
cat versions.txt
|
||||
export NEW_VERSION=$(curl -s -L https://raw.githubusercontent.com/kata-containers/runtime/${BRANCH}/VERSION)
|
||||
create_repo_cmd="./create-repo-branch.sh"
|
||||
if [ "${CI:-}" = "true" ]; then
|
||||
create_repo_cmd+=" --ci"
|
||||
fi
|
||||
create_repo_cmd+=" ${OBS_BRANCH}"
|
||||
script -qefc bash -c "${create_repo_cmd}"
|
||||
script -qefc bash -c './build_from_docker.sh ${NEW_VERSION}'
|
@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2019 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
set -o errtrace
|
||||
|
||||
export GOPATH=~/go
|
||||
export kata_repo="github.com/kata-containers/packaging"
|
||||
export pr_number=${GITHUB_PR:-}
|
||||
export pr_branch="PR_${pr_number}"
|
||||
|
||||
go get github.com/kata-containers/tests
|
||||
${GOPATH}/src/github.com/kata-containers/tests/.ci/resolve-kata-dependencies.sh
|
@ -1,20 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2017-2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
cidir=$(dirname "$0")
|
||||
source "${cidir}/../scripts/lib.sh"
|
||||
source /etc/os-release
|
||||
|
||||
pushd "${tests_repo_dir}"
|
||||
.ci/run.sh
|
||||
popd
|
||||
|
||||
# This script will execute packaging tests suite
|
@ -1,78 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
source /etc/os-release
|
||||
|
||||
SNAP_CI="${SNAP_CI:-false}"
|
||||
|
||||
echo "Setup script for packaging"
|
||||
|
||||
export tests_repo="${tests_repo:-github.com/kata-containers/tests}"
|
||||
export tests_repo_dir="$GOPATH/src/$tests_repo"
|
||||
|
||||
clone_tests_repo()
|
||||
{
|
||||
# KATA_CI_NO_NETWORK is (has to be) ignored if there is
|
||||
# no existing clone.
|
||||
if [ -d "$tests_repo_dir" -a -n "${KATA_CI_NO_NETWORK:-}" ]
|
||||
then
|
||||
return
|
||||
fi
|
||||
|
||||
go get -d -u "$tests_repo" || true
|
||||
}
|
||||
|
||||
clone_tests_repo
|
||||
|
||||
if [ "$SNAP_CI" == "true" ] && [ "$ID" == "ubuntu" ]; then
|
||||
# Do not install kata since we want to build, install and test the snap
|
||||
export INSTALL_KATA="no"
|
||||
|
||||
echo "Install snap dependencies"
|
||||
sudo apt-get --no-install-recommends install -y snapd snapcraft make
|
||||
|
||||
echo "Building snap image"
|
||||
make snap
|
||||
|
||||
echo "Install kata container snap"
|
||||
sudo snap install --dangerous --classic "$(basename kata-containers_*.snap)"
|
||||
|
||||
etc_confile="/etc/kata-containers/configuration.toml"
|
||||
usr_confile="/usr/share/defaults/kata-containers/configuration.toml"
|
||||
snap_confile="/snap/kata-containers/current/usr/share/defaults/kata-containers/configuration.toml"
|
||||
snap_bin_dir="/snap/kata-containers/current/usr/bin"
|
||||
|
||||
sudo rm -f /usr/local/bin/kata-runtime \
|
||||
/usr/bin/kata-runtime \
|
||||
/usr/local/bin/containerd-shim-kata-v2 \
|
||||
/usr/bin/containerd-shim-kata-v2 \
|
||||
"${etc_confile}" "${usr_confile}"
|
||||
|
||||
sudo ln -sf ${snap_bin_dir}/kata-runtime /usr/bin/kata-runtime
|
||||
sudo ln -sf ${snap_bin_dir}/kata-runtime /usr/local/bin/kata-runtime
|
||||
|
||||
sudo ln -sf ${snap_bin_dir}/containerd-shim-kata-v2 /usr/bin/containerd-shim-kata-v2
|
||||
sudo ln -sf ${snap_bin_dir}/containerd-shim-kata-v2 /usr/local/bin/containerd-shim-kata-v2
|
||||
|
||||
# copy configuration file since some tests modify it.
|
||||
sudo mkdir -p "$(dirname "${etc_confile}")" "$(dirname "${usr_confile}")"
|
||||
sudo cp "${snap_confile}" "${etc_confile}"
|
||||
sudo cp "${snap_confile}" "${usr_confile}"
|
||||
|
||||
# Use the same version of tests to test the snap
|
||||
git -C "${tests_repo_dir}" checkout "$(basename kata-containers_*.snap | cut -d_ -f2)"
|
||||
|
||||
"${tests_repo_dir}/cmd/container-manager/manage_ctr_mgr.sh" docker configure -r kata-runtime -f
|
||||
fi
|
||||
|
||||
pushd "${tests_repo_dir}"
|
||||
.ci/setup.sh
|
||||
popd
|
@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2018,2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -e
|
||||
|
||||
cidir=$(dirname "$0")
|
||||
source "${cidir}/lib.sh"
|
||||
|
||||
# Run static checks
|
||||
run_static_checks
|
@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# TODO: Add teardown steps as need
|
||||
true
|
@ -1,63 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
CI=${CI:-}
|
||||
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
readonly toplevel_mk="${script_dir}/../Makefile"
|
||||
source "${script_dir}/../scripts/lib.sh"
|
||||
|
||||
make_target() {
|
||||
target=$1
|
||||
dir=$2
|
||||
|
||||
pushd "${script_dir}/.." >>/dev/null
|
||||
|
||||
if ! git diff --name-only origin/master..HEAD ${dir} | grep ${dir}; then
|
||||
echo "Not changes in ${dir}"
|
||||
return
|
||||
fi
|
||||
case "${target}" in
|
||||
test-packaging-tools)
|
||||
skip_msg="skip $target see https://github.com/kata-containers/packaging/issues/72"
|
||||
[ -n "${CI}" ] && echo "${skip_msg}" && return
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
popd >>/dev/null
|
||||
echo "Changes found in ${dir}"
|
||||
make -f "${toplevel_mk}" "${target}"
|
||||
}
|
||||
|
||||
# Check that kata_confing_version file is updated
|
||||
# when there is any change in the kernel directory.
|
||||
# If there is a change in the directory, but the config
|
||||
# version is not updated, return error.
|
||||
check_kata_kernel_version() {
|
||||
kernel_version_file="kernel/kata_config_version"
|
||||
modified_files=$(git diff --name-only origin/master..HEAD)
|
||||
echo "Check Changes in kernel"
|
||||
git diff origin/master..HEAD ${kernel_version_file}
|
||||
git diff --name-only origin/master..HEAD
|
||||
if git whatchanged origin/master..HEAD "kernel/" | grep "kernel/" >>/dev/null; then
|
||||
echo "Kernel directory has changes check $kernel_version_file changed"
|
||||
echo "$modified_files" | grep "$kernel_version_file" ||
|
||||
die "Please bump version in $kernel_version_file"
|
||||
fi
|
||||
echo "OK - config version file was updated"
|
||||
|
||||
}
|
||||
|
||||
make_target test-release-tools "release/"
|
||||
make_target test-packaging-tools "obs-packaging/"
|
||||
make_target test-static-build "static-build/"
|
||||
make_target cmd-kata-pkgsync "cmd/kata-pkgsync"
|
||||
|
||||
[ -n "${CI}" ] && check_kata_kernel_version
|
@ -1,53 +0,0 @@
|
||||
on: issue_comment
|
||||
name: test-kata-deploy
|
||||
jobs:
|
||||
check_comments:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check for Command
|
||||
id: command
|
||||
uses: kata-containers/slash-command-action@v1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
command: "test-kata-deploy"
|
||||
reaction: "true"
|
||||
reaction-type: "eyes"
|
||||
allow-edits: "false"
|
||||
permission-level: admin
|
||||
- name: verify command arg is kata-deploy
|
||||
run: |
|
||||
echo "The command was '${{ steps.command.outputs.command-name }}' with arguments '${{ steps.command.outputs.command-arguments }}'"
|
||||
create-and-test-container:
|
||||
needs: check_comments
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: get-PR-ref
|
||||
id: get-PR-ref
|
||||
run: |
|
||||
ref=$(cat $GITHUB_EVENT_PATH | jq -r '.issue.pull_request.url' | sed 's#^.*\/pulls#refs\/pull#' | sed 's#$#\/merge#')
|
||||
echo "reference for PR: " ${ref}
|
||||
echo "##[set-output name=pr-ref;]${ref}"
|
||||
- uses: actions/checkout@v2-beta
|
||||
with:
|
||||
ref: ${{ steps.get-PR-ref.outputs.pr-ref }}
|
||||
- name: build-container-image
|
||||
id: build-container-image
|
||||
run: |
|
||||
PR_SHA=$(git log --format=format:%H -n1)
|
||||
VERSION=$(curl https://raw.githubusercontent.com/kata-containers/runtime/master/VERSION)
|
||||
ARTIFACT_URL="https://github.com/kata-containers/runtime/releases/download/${VERSION}/kata-static-${VERSION}-x86_64.tar.xz"
|
||||
wget "${ARTIFACT_URL}" -O ./kata-deploy/kata-static.tar.xz
|
||||
docker build --build-arg KATA_ARTIFACTS=kata-static.tar.xz -t katadocker/kata-deploy-ci:${PR_SHA} ./kata-deploy
|
||||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
|
||||
docker push katadocker/kata-deploy-ci:$PR_SHA
|
||||
echo "##[set-output name=pr-sha;]${PR_SHA}"
|
||||
- name: test-kata-deploy-ci-in-aks
|
||||
uses: ./kata-deploy/action
|
||||
with:
|
||||
packaging-sha: ${{ steps.build-container-image.outputs.pr-sha }}
|
||||
env:
|
||||
PKG_SHA: ${{ steps.build-container-image.outputs.pr-sha }}
|
||||
AZ_APPID: ${{ secrets.AZ_APPID }}
|
||||
AZ_PASSWORD: ${{ secrets.AZ_PASSWORD }}
|
||||
AZ_SUBSCRIPTION_ID: ${{ secrets.AZ_SUBSCRIPTION_ID }}
|
||||
AZ_TENANT_ID: ${{ secrets.AZ_TENANT_ID }}
|
@ -1,24 +0,0 @@
|
||||
#
|
||||
# Copyright 2017 HyperHQ Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
sudo: required
|
||||
dist: bionic
|
||||
|
||||
os:
|
||||
- linux
|
||||
- linux-ppc64le
|
||||
|
||||
language: go
|
||||
go_import_path: github.com/kata-containers/packaging
|
||||
|
||||
env:
|
||||
- target_branch=$TRAVIS_BRANCH
|
||||
|
||||
before_script:
|
||||
- ".ci/setup.sh"
|
||||
|
||||
script:
|
||||
- bash .ci/static-checks.sh github.com/kata-containers/packaging
|
@ -1 +0,0 @@
|
||||
1.11.0-rc0
|
Loading…
Reference in New Issue
Block a user