Skip to content

Commit

Permalink
[CI] Add some ci-script to automate various process
Browse files Browse the repository at this point in the history
  • Loading branch information
FanchTheSystem committed May 11, 2018
1 parent 1855a0a commit 234fd39
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 6 deletions.
1 change: 0 additions & 1 deletion bin/ci-scripts/gen_archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ rm -rf \
tar --exclude-vcs \
--exclude=build \
--exclude=bin/git-scripts \
--exclude=doc \
-czhf ${Filename} ./*

sha256sum ${Filename} > ${Filename}.sha256.txt
15 changes: 15 additions & 0 deletions bin/ci-scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -ex

# TODO share this between script (in an include)
if [ -f .env ]
then
source .env
else
echo "Please run this script from project root, and check .env file as it is mandatory"
echo "If it is missing a quick solution is :"
echo "ln -s .env.dist .env"
exit 42
fi

composer install --no-interaction --no-scripts
17 changes: 17 additions & 0 deletions bin/ci-scripts/post_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -ex

# TODO share this between script (in an include)
if [ -f .env ]
then
source .env
else
echo "Please run this script from project root, and check .env file as it is mandatory"
echo "If it is missing a quick solution is :"
echo "ln -s .env.dist .env"
exit 42
fi

bin/console assets:install --no-interaction


16 changes: 16 additions & 0 deletions bin/ci-scripts/run_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -ex

# TODO share this between script (in an include)
if [ -f .env ]
then
source .env
else
echo "Please run this script from project root, and check .env file as it is mandatory"
echo "If it is missing a quick solution is :"
echo "ln -s .env.dist .env"
exit 42
fi

echo "waiting for test creation"

16 changes: 16 additions & 0 deletions bin/ci-scripts/server_start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -ex

# TODO share this between script (in an include)
if [ -f .env ]
then
source .env
else
echo "Please run this script from project root, and check .env file as it is mandatory"
echo "If it is missing a quick solution is :"
echo "ln -s .env.dist .env"
exit 42
fi

bin/console server:start --no-interaction

2 changes: 1 addition & 1 deletion bin/ci-scripts/set_env_with_etcd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fi

if [ -z "$Prefix" ]
then
Prefix="/pia/build/$Suffix"
Prefix="/pialabback/build/$Suffix"
fi

if [ -z "$ETCDHOST" ]
Expand Down
8 changes: 4 additions & 4 deletions etc/pipeline.jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pipeline {

stage ('Composer Install') {
steps {
sh "composer install --no-interaction --no-scripts"
sh "./bin/ci-scripts/install.sh"
}
}

Expand All @@ -57,19 +57,19 @@ pipeline {

stage ('Install Assets ') {
steps {
sh "bin/console assets:install"
sh "./bin/ci-scripts/post_install.sh"
}
}

stage ('Start ') {
steps {
sh "bin/console server:start --no-interaction"
sh "./bin/ci-scripts/server_start.sh"
}
}

stage ('Run Test') {
steps {
sh "echo waiting for test creation"
sh "./bin/ci-scripts/run_test.sh"
}
}

Expand Down

0 comments on commit 234fd39

Please sign in to comment.