| dist: trusty |
| sudo: required |
| |
| addons: |
| apt: |
| sources: |
| - sourceline: 'deb http://apt-mk.mirantis.com/trusty nightly salt' |
| - key_url: 'http://apt-mk.mirantis.com/public.gpg' |
| packages: |
| - curl |
| - subversion |
| - git |
| - salt-master |
| - salt-minion |
| - reclass |
| - python-pip |
| - tree |
| |
| |
| #git: |
| # submodules: false |
| # |
| before_install: |
| - sudo pip install cookiecutter |
| # - test ! -e .gitmodules || sed -i 's,https://\([.a-z0-9_-]*\)/\(.*\),git@\1:\2,' .gitmodules |
| # - test ! -e .gitmodules || git submodule update --init --recursive --remote |
| |
| env: |
| global: |
| - ENV_DOMAIN=ci.local |
| matrix: |
| - CLUSTER_NAME=openstack_mk_contrail |
| - CLUSTER_NAME=openstack_mk_ovs |
| - CLUSTER_NAME=kubernetes_mk |
| |
| install: |
| - export RECLASS_SYSTEM=file://$PWD |
| - mkdir ../$CLUSTER_NAME; cd ../$CLUSTER_NAME |
| - export RECLASS_REPO_PATH=$PWD |
| - export RECLASS_REPOSITORY=file://$RECLASS_REPO_PATH |
| - git clone git@github.com:Mirantis/mk2x-cookiecutter-reclass-model.git ../cookiecutter_models; cd ../cookiecutter_models |
| - export COOKIECUTTER_BASE=$PWD |
| - export ENV_DOMAIN=ci.local |
| - COOKIECUTTER_JSON=$COOKIECUTTER_BASE/cluster/$CLUSTER_NAME/cookiecutter.json |
| #- export ENV_DOMAIN=${CLUSTER_NAME//_/-}.$ENV_DOMAIN |
| - export MASTER_HOSTNAME=cfg01.$ENV_DOMAIN |
| - cd $RECLASS_REPO_PATH |
| - git init . |
| # CI WORKAROUNDS |
| - export FORMULAS_SOURCE=pkg |
| - sed -i "s/deployment_name/$CLUSTER_NAME/g" $COOKIECUTTER_JSON |
| - sed -i "s/deploy-name.local/$ENV_DOMAIN/g" $COOKIECUTTER_JSON |
| - sed -i 's%.*reclass_repository.*%"reclass_repository":"'$RECLASS_REPOSITORY'",%g' $COOKIECUTTER_JSON |
| - cookiecutter $COOKIECUTTER_BASE/cluster/$CLUSTER_NAME --output-dir ./classes/cluster --no-input |
| - git add ./* |
| - git commit -am "Init, add cluster level" |
| - git submodule add $RECLASS_SYSTEM ./classes/system |
| - | |
| mkdir -p nodes; |
| git branch -a |
| tree -lL 3 |
| cat <<-EOF > nodes/cfg01.$ENV_DOMAIN.yml |
| classes: |
| - cluster.$CLUSTER_NAME.infra.config |
| parameters: |
| _param: |
| linux_system_codename: trusty |
| reclass_data_revision: master |
| linux: |
| system: |
| name: cfg01 |
| domain: $ENV_DOMAIN |
| # ####################### |
| |
| - git add ./* |
| - git commit -am "Add system level and salt-master node" |
| # CI WORKAROUNDS |
| - export RECLASS_BRANCH=master |
| #- sed -ie "s#\(reclass_data_revision.\).*#\1 $RECLASS_BRANCH#" $(find nodes -name ${MASTER_HOSTNAME}.yml|tail -n1) |
| #- git commit -am "Fake branch update" || true |
| # PREREQUSITES |
| - sudo mkdir /srv/salt; sudo cp -a $PWD /srv/salt/reclass |
| - sudo svn export --force https://github.com/salt-formulas/salt-formulas/trunk/deploy/scripts /srv/salt/scripts |
| |
| script: |
| - cd /srv/salt/scripts |
| - sudo ./salt-master-init.sh || exit 1 |
| |
| after_failure: |
| - tree -lL 3 $RECLASS_REPO_PATH |
| - for i in ls -lta "/tmp/*verify*"; do echo -e "\n\n$i:";tail -n20 $i; done |