Skip to content

Commit

Permalink
Fix Jenkinsfile so builds work again (#48)
Browse files Browse the repository at this point in the history
* Fix Jenkinsfile so builds work again

This had shell syntax in the groovy file. Fix it so that it
embeds the shell syntax inside a Jenkins groovy `sh` call.

* Fix syntax: else vs elif

* brew install is not idempotent

This fails, see https://travis-ci.com/ModusCreateOrg/genus/jobs/153073183

This is why we have to have all the brew dependencies in the Brewfile,
and not try to `brew install` anything after that.

* Switch to ssh for git if creative-engine not found

* Force update of cmake if it is outdated with brew

* Ooops, revert Brewfile, that was committed in error

* Force update of cmake (brew is not idempotent)

* Crank up debugging

* Use script instead of install with travis

This was failing with:

```

$ ./scripts/build.sh
...  # successful build of genus !
0.01s$ ./configure && make && make test
/Users/travis/.travis/job_stages: line 104: ./configure: No such file or directory
The command "./configure && make && make test" exited with 127.
Done. Your build exited with 1.
```
It looks like the default Travis script is to run:
```./configure && make && make test```
So let's have it just run the script.

* Crank debug level back down to normal
  • Loading branch information
obscurerichard authored and mschwartz committed Oct 24, 2018
1 parent d1a6a97 commit ab6612a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ language: cpp

before_install: git clone git@github.com:ModusCreateOrg/creative-engine.git

install: ./scripts/build.sh
script: ./scripts/build.sh
14 changes: 8 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ pipeline {
}
stage('Build') {
steps {
OS="$(uname)"
if [ "$OS" == "Darwin" ]; then
sh "scripts/build.sh"
elif
sh "scripts/docker-build.sh"
fi
sh '''
OS="$(uname)"
if [ "$OS" == "Darwin" ]; then
scripts/build.sh
else
scripts/docker-build.sh
fi
'''
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export DIR BUILD_DIR TOP_DIR CREATIVE_ENGINE_DIR
op=${1:-}
SKIP_TOOLS_INSTALL=false
SUDO="sudo"
export SUDO

case "$op" in
clean)
Expand All @@ -50,10 +51,8 @@ elif [ "$OS" == "Darwin" ]; then
# Install homebrew packages
cd "$BASE_DIR"
brew bundle install
brew install doxygen
brew install imagemagick
brew install SDL2
brew install SDL2_image
# Travis has an older brew version of cmake, be sure we have the latest or this will not build
brew upgrade cmake || true
elif [ "$(cut -c1-5 <<<"$OS")" == "Linux" ]; then
# Do something under GNU/Linux platform
if [[ -n "$(which apt-get 2>/dev/null)" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function ensure_arch_devtools_installed {

function ensure_creative_engine {
if [[ ! -d "$CREATIVE_ENGINE_DIR" ]]; then
git clone https://github.com/ModusCreateOrg/creative-engine.git "$CREATIVE_ENGINE_DIR"
git clone git@github.com:ModusCreateOrg/creative-engine.git "$CREATIVE_ENGINE_DIR"
fi
}

Expand Down

0 comments on commit ab6612a

Please sign in to comment.