Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
ci: Add initial CI scripts
Browse files Browse the repository at this point in the history
Add base scripts to setup, run, and teardown tests for ci.

Fixes: #21

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
  • Loading branch information
jcvenegas committed Apr 26, 2018
1 parent d3e8d9c commit e8600d1
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .ci/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
#
# Copyright (c) 2017-2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#

set -o errexit
set -o nounset
set -o pipefail

# This script will execute packaing tests suite
# TODO: Add steps neded to build packages
true
12 changes: 12 additions & 0 deletions .ci/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#

set -o errexit
set -o nounset
set -o pipefail

echo "Setup script for packaging"
14 changes: 14 additions & 0 deletions .ci/static-checks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#

set -o errexit
set -o nounset
set -o pipefail

# This script should run any static analysis check
# It is called by the CI setup
true
13 changes: 13 additions & 0 deletions .ci/teardown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/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
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
#

MK_DIR :=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
.PHONY: test test-release-tools

test: test-release-tools

test-release-tools:
@$(MK_DIR)/release/tag_repos_test.sh
3 changes: 2 additions & 1 deletion release/tag_repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ tag_repos() {

info "Creating tag ${kata_version} in all repos"
for repo in "${repos[@]}"; do
git clone --quiet "git@github.com:${OWNER}/${repo}.git"
git clone --quiet "https://github.com/${OWNER}/${repo}.git"
pushd "${repo}"
git remote set-url --push origin "git@github.com:${OWNER}/${repo}.git"
git fetch origin --tags
if git rev-parse -q --verify "refs/tags/${kata_version}"; then
info "$repo already has tag "
Expand Down
22 changes: 22 additions & 0 deletions release/tag_repos_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#

set -o errexit
set -o nounset
set -o pipefail

echo "Check tag_repos.sh show help"
./release/tag_repos.sh | grep Usage

echo "Check tag_repos.sh -h option"
./release/tag_repos.sh -h | grep Usage

echo "Check tag_repos.sh status"
./release/tag_repos.sh status | grep runtime

echo "Check tag_repos.sh create tags but not push"
./release/tag_repos.sh tag

0 comments on commit e8600d1

Please sign in to comment.