From a8d728e407ce2372afb472db802c609e5d57d74a Mon Sep 17 00:00:00 2001 From: Archana Shinde Date: Wed, 13 Nov 2019 16:13:41 -0800 Subject: [PATCH] Move to script Signed-off-by: Archana Shinde --- .github/workflows/dedup-jobs.yaml | 21 +++-------- .../workflows/generate-artifact-tarball.sh | 35 ++++++++++++++----- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/.github/workflows/dedup-jobs.yaml b/.github/workflows/dedup-jobs.yaml index 9dd61c315..d411cf5d9 100644 --- a/.github/workflows/dedup-jobs.yaml +++ b/.github/workflows/dedup-jobs.yaml @@ -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 diff --git a/.github/workflows/generate-artifact-tarball.sh b/.github/workflows/generate-artifact-tarball.sh index aa0d7684d..92701d8f0 100755 --- a/.github/workflows/generate-artifact-tarball.sh +++ b/.github/workflows/generate-artifact-tarball.sh @@ -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 $@