Skip to content

Commit

Permalink
add concourse scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
keedya committed Aug 23, 2017
1 parent 6971182 commit 396b2d4
Show file tree
Hide file tree
Showing 11 changed files with 113 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Copyright 2016, EMC, Inc.

FROM rackhd/on-core:devel
ARG repo=rackhd
ARG tag=devel

FROM ${repo}/on-core:${tag}

COPY . /RackHD/on-tftp/
WORKDIR /RackHD/on-tftp
Expand Down
3 changes: 1 addition & 2 deletions HWIMO-BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ set -e
set -x

rm -rf packagebuild
git clone . packagebuild
rsync -L -r . packagebuild
pushd packagebuild
cp ../package.json .

rm -rf node_modules
npm install --cache=`pwd`
npm prune --production
git log -n 1 --pretty=format:%h.%ai.%s > commitstring.txt
Expand Down
8 changes: 8 additions & 0 deletions alpha/build_deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash -ex

./alpha/set_dependencies.sh

./HWIMO-BUILD
pwd
ls -l
cp *.deb ../build
13 changes: 13 additions & 0 deletions alpha/build_deb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
platform: linux

inputs:
- name: on-tftp
- name: on-core
- name: manifest-artifactory
outputs:
- name: build

run:
path: "alpha/build_deb.sh"
dir: "on-tftp"
12 changes: 12 additions & 0 deletions alpha/build_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash -ex

if [ "${VERIFY_DEP}" == "true" ]; then
COMMIT=$(cat $(ls ../manifest-artifactory/manifest*.json) | jq -r .ontftp.commit)
git config --add remote.origin.fetch +refs/pull/*/head:refs/remotes/origin/pull/*
git fetch
git checkout $COMMIT
export ONCORE_TAG=$(<../on-core-docker/digest)
sed -i "s/^FROM.*/FROM $REGISTRY\/${REPO_OWNER}\/on-core@${ONCORE_TAG}/" ./Dockerfile
fi
cat Dockerfile
cp -rf * ../build
13 changes: 13 additions & 0 deletions alpha/build_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
platform: linux

inputs:
- name: on-tftp
- name: manifest-artifactory
- name: on-core-docker
outputs:
- name: build

run:
path: "alpha/build_docker.sh"
dir: "on-tftp"
11 changes: 11 additions & 0 deletions alpha/post_build_deb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
platform: linux

inputs:
- name: on-tftp
outputs:
- name: build

run:
path: "alpha/build_deb.sh"
dir: "on-tftp"
8 changes: 8 additions & 0 deletions alpha/post_unittest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
platform: linux

inputs:
- name: on-tftp
run:
path: "alpha/unittest.sh"
dir: "on-tftp"
26 changes: 26 additions & 0 deletions alpha/set_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash -ex

if [ "${VERIFY_DEP}" == "true" ]; then
COMMIT=$(cat $(ls ../manifest-artifactory/manifest*.json) | jq -r .ontftp.commit)
git config --add remote.origin.fetch +refs/pull/*/head:refs/remotes/origin/pull/*
git fetch
git checkout $COMMIT
pushd ../on-core
COMMIT=$(cat $(ls ../manifest-artifactory/manifest*.json) | jq -r .oncore.commit)
git config --add remote.origin.fetch +refs/pull/*/head:refs/remotes/origin/pull/*
git fetch
git checkout $COMMIT
rm -rf .git
popd
mkdir -p node_modules

# Map on-core
pushd ../
ln -s $(pwd)/on-core $(pwd)/on-tftp/node_modules/on-core
popd

# Run npm install for on-core
pushd ../on-core
npm install
popd
fi
7 changes: 7 additions & 0 deletions alpha/unittest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh -ex
./alpha/set_dependencies.sh
ps -aux
service rabbitmq-server start
/usr/bin/mongod --fork --logpath /var/log/mongodb/monngod.log
npm install
./node_modules/.bin/_mocha $(find spec -name '*-spec.js') --timeout 10000 --require spec/helper.js
10 changes: 10 additions & 0 deletions alpha/unittest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
platform: linux

inputs:
- name: on-tftp
- name: on-core
- name: manifest-artifactory
run:
path: "alpha/unittest.sh"
dir: "on-tftp"

0 comments on commit 396b2d4

Please sign in to comment.