diff --git a/.tarignore b/.tarignore new file mode 100644 index 0000000..60c9a9f --- /dev/null +++ b/.tarignore @@ -0,0 +1,4 @@ +node_modules +npm-debug.log +bin +.git diff --git a/.travis.yml b/.travis.yml index eae8311..e5f2023 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,6 @@ node_js: # services: # - docker - before_install: #Install cloudfoundry - bash bin/setup.sh @@ -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 + # + on: + branch: testTravis + - provider: script + skip_cleanup: true + script: + - bin/moveOver.sh + on: + branch: testTravis +after_deploy: + - bin/afterDeploy.sh diff --git a/README.md b/README.md index fb92f1d..996f39e 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ -# troll-gate \ No newline at end of file +# troll-gate +# diff --git a/bin/afterDeploy.sh b/bin/afterDeploy.sh new file mode 100755 index 0000000..d190b8b --- /dev/null +++ b/bin/afterDeploy.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "send event to github" diff --git a/bin/copy2S3.sh b/bin/copy2S3.sh new file mode 100755 index 0000000..ba90685 --- /dev/null +++ b/bin/copy2S3.sh @@ -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 diff --git a/bin/deploy2bm.sh b/bin/deploy2bm.sh index b8ecc0d..4f348d3 100755 --- a/bin/deploy2bm.sh +++ b/bin/deploy2bm.sh @@ -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" diff --git a/bin/moveOver.sh b/bin/moveOver.sh new file mode 100755 index 0000000..9504f05 --- /dev/null +++ b/bin/moveOver.sh @@ -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" diff --git a/manifest.yml b/manifest.yml index 02d5a0c..99f163c 100644 --- a/manifest.yml +++ b/manifest.yml @@ -4,5 +4,5 @@ applications: instances: 1 domain: mybluemix.net name: troll-gate - host: troll-gate + host: todd-gate disk_quota: 1024M diff --git a/playbook.yml b/playbook.yml new file mode 100644 index 0000000..0ee50f8 --- /dev/null +++ b/playbook.yml @@ -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}}" diff --git a/taskbook.yml b/taskbook.yml new file mode 100644 index 0000000..190ba8e --- /dev/null +++ b/taskbook.yml @@ -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}}"