Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .tarignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
npm-debug.log
bin
.git
47 changes: 35 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ node_js:
# services:
# - docker


before_install:
#Install cloudfoundry
- bash bin/setup.sh
Expand All @@ -30,20 +29,44 @@ after_success:
# - docker run -t webdevops/ansible:alpine-3 ansible --help


deploy:
#provide: ansible?
provider: script
skip_cleanup: true
script:
- bin/deploy2bm.sh
# - bin/deploy2bm.sh
# - docker run -t webdevops/ansible:alpine-3 ansible --help

on:
branch: testTravis
# deploy:
# #provide: ansible?
# provider: script
# skip_cleanup: true
# script:
# # - bin/deploy2bm.sh
# - bin/moveOver.sh
#
# on:
# branch: testTravis


# configure notifications (email, IRC, campfire etc)
# please update this section to your needs!
#notifications:
# irc: "irc.freenode.org#travis"

deploy:
- provider: script
skip_cleanup: true
script:
- bin/copy2S3.sh
on:
branch: testTravis

- provider: s3
bucket: "thetodd"
skip_cleanup: true
local_dir: ./s3
# - provider: script
# <TOWER STUFF HERE>
on:
branch: testTravis
- provider: script
skip_cleanup: true
script:
- bin/moveOver.sh
on:
branch: testTravis
after_deploy:
- bin/afterDeploy.sh
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# troll-gate
# troll-gate
#
3 changes: 3 additions & 0 deletions bin/afterDeploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

echo "send event to github"
27 changes: 27 additions & 0 deletions bin/copy2S3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

#Make account.yml
echo "---" > account.yml
echo "username: $BLUEMIX_USER" >> account.yml
echo "password: $BLUEMIX_PASSWORD" >> account.yml
echo "org: $BLUEMIX_ORG" >> account.yml
echo "space: $BLUEMIX_SPACE" >> account.yml
echo "" >> account.yml
echo "Created account.yml"

#make app.yml
echo "---" > app.yml
echo "app_name: openfirst-gate" >> app.yml
echo "manifest_path: manifest.yml" >> app.yml
echo "" >> app.yml
echo "Created app.yml"

echo "deploy to ...$AWS_DEFAULT_REGION..."

#Copy over artifacts
tar -cvzf jesse.tar -X .tarignore .
mkdir s3
mv jesse.tar s3

pwd
ls -la s3
2 changes: 1 addition & 1 deletion bin/deploy2bm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ STATUS=$(curl -s -o /dev/null -w '%{http_code}' "http://troll-gate.mybluemix.net
# STATUS=400
if [ $STATUS -eq 200 ]; then
echo "Deployment approved."
cd ansible && ansible-playbook cf_push.yml && cd -
# cd ansible && ansible-playbook cf_push.yml && cd -
else
echo "Deployment not approved. $STATUS"
CANCEL_URL="https://api.travis-ci.org/builds/$TRAVIS_BUILD_ID/cancel"
Expand Down
50 changes: 50 additions & 0 deletions bin/moveOver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

# echo "Check the gate."
# ./bin/deploy2bm.sh
# if [ $? != 0 ]; then
# exit 1
# fi
#
# echo "Gate checked."
#
# #Make account.yml
# echo "---" > account.yml
# echo "username: $BLUEMIX_USER" >> account.yml
# echo "password: $BLUEMIX_PASSWORD" >> account.yml
# echo "org: $BLUEMIX_ORG" >> account.yml
# echo "space: $BLUEMIX_SPACE" >> account.yml
# echo "" >> account.yml
# echo "Created account.yml"
#
# #make app.yml
# echo "---" > app.yml
# echo "app_name: openfirst-gate" >> app.yml
# echo "manifest_path: manifest.yml" >> app.yml
# echo "" >> app.yml
# echo "Created app.yml"
#
# #copy over our key
# echo -e $SERVER_KEY > ~/.ssh/id_rsa
# chmod 700 ~/.ssh/id_rsa
#
# echo "Created id_rsa"
#
# #Copy over artifacts
# tar -cvzf jesse.tar -X .tarignore .
# ssh -oStrictHostKeyChecking=no "root@$TOWER_IP" "mkdir /var/lib/awx/projects/$PROJECT_PATH"
# echo "mkdir /var/lib/awx/projects/$PROJECT_PATH"
# scp jesse.tar "root@$TOWER_IP":/var/lib/awx/projects/$PROJECT_PATH
# echo "scp complete"
# ssh -oStrictHostKeyChecking=no "root@$TOWER_IP" "tar -xvzf /var/lib/awx/projects/$PROJECT_PATH/jesse.tar -C /var/lib/awx/projects/$PROJECT_PATH"

# git clone https://github.com/jcantosz/towerTalker.git
git clone -b tarballs https://github.com/jcantosz/towerTalker.git
#run node app
cd towerTalker

echo "npm install"
npm install
echo "npm start"
npm start
echo "DONE"
2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ applications:
instances: 1
domain: mybluemix.net
name: troll-gate
host: troll-gate
host: todd-gate
disk_quota: 1024M
19 changes: 19 additions & 0 deletions playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Publish this application to bluemix using ansible
---
- name: Publish the troll-gate to Bluemix using Ansible
hosts: localhost
connection: local
vars_files:
- "account.yml"
- "app.yml"
tasks:
- name: Auth to IBM Bluemix
bluemix_login: >
username="{{username}}"
password="{{password}}"
org="{{org}}"
space="{{space}}"
- name: CF Push App
bluemix_push: >
app_name="{{app_name}}"
manifest_path="{{manifest_path}}"
12 changes: 12 additions & 0 deletions taskbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Publish this application to bluemix using ansible
---
- name: Auth to IBM Bluemix
bluemix_login: >
username="{{username}}"
password="{{password}}"
org="{{org}}"
space="{{space}}"
- name: CF Push App
bluemix_push: >
app_name="{{app_name}}"
manifest_path="{{manifest_path}}"