Move to script

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit is contained in:
Archana Shinde
2019-11-13 16:13:41 -08:00
parent 041a22eb14
commit a8d728e407
2 changed files with 31 additions and 25 deletions

View File

@@ -28,28 +28,15 @@ jobs:
uses: actions/download-artifact@master
with:
name: artifact-list
#- run: |
# sudo apt-get update && sudo apt install -y flex bison libelf-dev bc iptables
- name: build-kernel
run: |
if grep -q "install_kernel" ./artifact-list/artifact-list.txt; then
ls -la $GITHUB_WORKSPACE
.github/workflows/generate-artifact-tarball.sh "install_kernel" $GITHUB_REF
# install kernel dependencies
sudo apt-get update && sudo apt install -y flex bison libelf-dev bc iptables
export GOPATH=$HOME/go
go get github.com/kata-containers/packaging || true
pushd $GOPATH/src/github.com/kata-containers/packaging/release >>/dev/null
# Get versions information
tag=`echo $GITHUB_REF | cut -d/ -f3-`
git checkout $tag
pushd ../obs-packaging
./gen_versions_txt.sh $tag
popd
# Build the kernel:
source ./kata-deploy-binaries.sh
install_kernel
$GITHUB_WORKSPACE/.github/workflows/generate-artifact-tarball.sh "install_kernel" $GITHUB_REF
echo ::set-env name=artifact-built::true
popd >>/dev/null
mv $HOME/go/src/github.com/kata-containers/packaging/release/kata-kernel.tar.gz .
ls -la $GITHUB_WORKSPACE
else
echo ::set-env name=artifact-built::false
fi

View File

@@ -6,29 +6,48 @@
[ -z "${DEBUG}" ] || set -x
set -o errexit
set -o nounset
#set -o nounset
set -o pipefail
main() {
artifact=${1:-}
if [ -n "${artifact}" ]; then
artifact_stage=${1:-}
artifact=$(echo ${artifact_stage} | sed -n -e 's/^install_//p')
if [ -z "${artifact}" ]; then
"Scripts needs artifact name to build"
exit 1
fi
info "artifact name: ${artifact}"
github_ref=${2:-}
if [ -n "${github_ref}" ]; then
"Scripts needs githun reference to build"
if [ -z "${github_ref}" ]; then
"Scripts needs github reference to build"
exit 1
fi
tag=`echo ${github_ref} | cut -d/ -f3-`
export GOPATH=$HOME/go
echo tag: "tag"
echo artifact "artifact_name"
echo tag: "$tag"
echo artifact "$artifact"
echo artifact_stage "$artifact_stage"
tag="1.9.0-rc0"
export GOPATH=$HOME/go
go get github.com/kata-containers/packaging || true
pushd $GOPATH/src/github.com/kata-containers/packaging/release >>/dev/null
git checkout $tag
#git checkout master
pushd ../obs-packaging
echo "Running gen_versions_txt.sh with tag $tag"
./gen_versions_txt.sh $tag
popd
ls -la
echo $pwd
source ./kata-deploy-binaries.sh
#${artifact_stage}
install_kernel
popd
}
main $@