From 44748607444c3f3e1ec094e0ba847033b7fc2ac0 Mon Sep 17 00:00:00 2001 From: Adam King Date: Wed, 16 Nov 2016 11:06:40 -0500 Subject: [PATCH 01/28] Deploy to Ansible tower --- .travis.yml | 3 +-- bin/moveOver.sh | 29 +++++++++++++++++++++++++++++ playbook.yml | 23 +++++++++++++++++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 bin/moveOver.sh create mode 100644 playbook.yml diff --git a/.travis.yml b/.travis.yml index eae8311..e738651 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,9 +35,8 @@ deploy: provider: script skip_cleanup: true script: - - bin/deploy2bm.sh # - bin/deploy2bm.sh -# - docker run -t webdevops/ansible:alpine-3 ansible --help + - bin/moveOver.sh on: branch: testTravis diff --git a/bin/moveOver.sh b/bin/moveOver.sh new file mode 100644 index 0000000..05f7e0e --- /dev/null +++ b/bin/moveOver.sh @@ -0,0 +1,29 @@ +#!/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 + +#make app.yml +echo "---" > app.yml +echo "app_name: what-a-todd" >> app.yml +echo "manifest_path: manifest.yml" >> app.yml +echo "" >> app.yml + +#copy over our key +echo -e $SERVER_KEY > ~/.ssh/id_rsa +chmod 700 ~/.ssh/id_rsa + +#Copy over artifacts +ssh "root@$TOWER_IP" "mkdir /var/lib/awx/projects/$PROJECT_PATH" +scp -r ./ "root@$TOWER_IP":/var/lib/awx/projects/$PROJECT_PATH + +git clone https://github.com/jcantosz/towerTalker.git +#run node app +cd towerTalker +npm install +npm start diff --git a/playbook.yml b/playbook.yml new file mode 100644 index 0000000..401cca2 --- /dev/null +++ b/playbook.yml @@ -0,0 +1,23 @@ +# Publish this application to bluemix using ansible +--- +- name: Publish the troll-gate to Bluemix using Ansible + hosts: localhost + connection: local + vars: + BLUEMIX_USER: "{{ lookup('env','BLUEMIX_USER') }}" + BLUEMIX_PASSWORD: "{{ lookup('env','BLUEMIX_PASSWORD') }}" + org: "rak_org" + space: "dev" + app_name: "troll-gate" + manifest_path: ".." + tasks: + - name: Auth to IBM Bluemix + bluemix_login: > + username="{{BLUEMIX_USER}}" + password="{{BLUEMIX_PASSWORD}}" + org="{{org}}" + space="{{space}}" + - name: CF Push App + bluemix_push: > + app_name="{{app_name}}" + manifest_path="{{manifest_path}}" From a493f3b9cfb10cf7a39ae019885be00499253b21 Mon Sep 17 00:00:00 2001 From: Adam King Date: Wed, 16 Nov 2016 11:18:43 -0500 Subject: [PATCH 02/28] Add debug, fix playbook --- bin/moveOver.sh | 10 ++++++++++ playbook.yml | 14 +++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) mode change 100644 => 100755 bin/moveOver.sh diff --git a/bin/moveOver.sh b/bin/moveOver.sh old mode 100644 new mode 100755 index 05f7e0e..7ca2276 --- a/bin/moveOver.sh +++ b/bin/moveOver.sh @@ -7,23 +7,33 @@ 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: what-a-todd" >> 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 ssh "root@$TOWER_IP" "mkdir /var/lib/awx/projects/$PROJECT_PATH" +echo "mkdir /var/lib/awx/projects/$PROJECT_PATH" scp -r ./ "root@$TOWER_IP":/var/lib/awx/projects/$PROJECT_PATH +echo "scp complete" git clone 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/playbook.yml b/playbook.yml index 401cca2..0ee50f8 100644 --- a/playbook.yml +++ b/playbook.yml @@ -3,18 +3,14 @@ - name: Publish the troll-gate to Bluemix using Ansible hosts: localhost connection: local - vars: - BLUEMIX_USER: "{{ lookup('env','BLUEMIX_USER') }}" - BLUEMIX_PASSWORD: "{{ lookup('env','BLUEMIX_PASSWORD') }}" - org: "rak_org" - space: "dev" - app_name: "troll-gate" - manifest_path: ".." + vars_files: + - "account.yml" + - "app.yml" tasks: - name: Auth to IBM Bluemix bluemix_login: > - username="{{BLUEMIX_USER}}" - password="{{BLUEMIX_PASSWORD}}" + username="{{username}}" + password="{{password}}" org="{{org}}" space="{{space}}" - name: CF Push App From 4a0bf5a2840bf1fc728d464e8e2deea8e8c2fb28 Mon Sep 17 00:00:00 2001 From: Adam King Date: Wed, 16 Nov 2016 11:25:04 -0500 Subject: [PATCH 03/28] ssh -oStrictHostKeyChecking=no --- bin/moveOver.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/moveOver.sh b/bin/moveOver.sh index 7ca2276..3b19795 100755 --- a/bin/moveOver.sh +++ b/bin/moveOver.sh @@ -23,7 +23,7 @@ chmod 700 ~/.ssh/id_rsa echo "Created id_rsa" #Copy over artifacts -ssh "root@$TOWER_IP" "mkdir /var/lib/awx/projects/$PROJECT_PATH" +ssh -oStrictHostKeyChecking=no "root@$TOWER_IP" "mkdir /var/lib/awx/projects/$PROJECT_PATH" echo "mkdir /var/lib/awx/projects/$PROJECT_PATH" scp -r ./ "root@$TOWER_IP":/var/lib/awx/projects/$PROJECT_PATH echo "scp complete" From cc908e0c0cdf46f518e57744465c368328fb1f97 Mon Sep 17 00:00:00 2001 From: Adam King Date: Wed, 16 Nov 2016 12:57:28 -0500 Subject: [PATCH 04/28] tar files before pushing to bluemix --- .tarignore | 4 ++++ .travis.yml | 2 +- bin/moveOver.sh | 4 +++- manifest.yml | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .tarignore 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 e738651..45528ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ deploy: provider: script skip_cleanup: true script: -# - bin/deploy2bm.sh + - bin/deploy2bm.sh - bin/moveOver.sh on: diff --git a/bin/moveOver.sh b/bin/moveOver.sh index 3b19795..8531d54 100755 --- a/bin/moveOver.sh +++ b/bin/moveOver.sh @@ -23,10 +23,12 @@ 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 -r ./ "root@$TOWER_IP":/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 #run node app 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 From 79e2b969f5dcbecab48e681516f8dc9264bb5660 Mon Sep 17 00:00:00 2001 From: Adam King Date: Wed, 16 Nov 2016 13:05:27 -0500 Subject: [PATCH 05/28] defer bluemix deployment to tower --- bin/deploy2bm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From 40ade1270277c20b59b25b4ac5734a4ab3321145 Mon Sep 17 00:00:00 2001 From: Adam King Date: Wed, 16 Nov 2016 13:10:46 -0500 Subject: [PATCH 06/28] one deploy script --- bin/moveOver.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/moveOver.sh b/bin/moveOver.sh index 8531d54..0fb11ad 100755 --- a/bin/moveOver.sh +++ b/bin/moveOver.sh @@ -1,5 +1,7 @@ #!/bin/bash +./bin/deploy2bm.sh + #Make account.yml echo "---" > account.yml echo "username: $BLUEMIX_USER" >> account.yml From 22edb29e603b4210775460f541871313cca8b3a8 Mon Sep 17 00:00:00 2001 From: Adam King Date: Wed, 16 Nov 2016 13:17:11 -0500 Subject: [PATCH 07/28] debug moveOver --- bin/moveOver.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/moveOver.sh b/bin/moveOver.sh index 0fb11ad..843953e 100755 --- a/bin/moveOver.sh +++ b/bin/moveOver.sh @@ -1,7 +1,10 @@ #!/bin/bash +echo "Check the gate." ./bin/deploy2bm.sh +echo "Gate checked." + #Make account.yml echo "---" > account.yml echo "username: $BLUEMIX_USER" >> account.yml From 9c63a08dbcda39255f7bd0b3bbc5e2dfd13fe3f4 Mon Sep 17 00:00:00 2001 From: Adam King Date: Wed, 16 Nov 2016 13:28:10 -0500 Subject: [PATCH 08/28] run one deploy script --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 45528ec..8885559 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ deploy: provider: script skip_cleanup: true script: - - bin/deploy2bm.sh + # - bin/deploy2bm.sh - bin/moveOver.sh on: From 8bf12cf35c8dde2300d039f52c67cfe3241ee664 Mon Sep 17 00:00:00 2001 From: Adam King Date: Thu, 17 Nov 2016 09:13:20 -0500 Subject: [PATCH 09/28] update appname --- bin/moveOver.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/moveOver.sh b/bin/moveOver.sh index 843953e..7bffb72 100755 --- a/bin/moveOver.sh +++ b/bin/moveOver.sh @@ -16,7 +16,7 @@ echo "Created account.yml" #make app.yml echo "---" > app.yml -echo "app_name: what-a-todd" >> app.yml +echo "app_name: openfirst-gate" >> app.yml echo "manifest_path: manifest.yml" >> app.yml echo "" >> app.yml echo "Created app.yml" From a70429e4eec59c5453913d180ad65b31c20f1f91 Mon Sep 17 00:00:00 2001 From: Adam King Date: Thu, 17 Nov 2016 09:32:28 -0500 Subject: [PATCH 10/28] check gate response --- bin/moveOver.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/moveOver.sh b/bin/moveOver.sh index 7bffb72..5dacb1f 100755 --- a/bin/moveOver.sh +++ b/bin/moveOver.sh @@ -2,6 +2,9 @@ echo "Check the gate." ./bin/deploy2bm.sh +if [ $? != 0 ]; then + exit 1 +fi echo "Gate checked." From 2e24659b1377f335d0c6b0eb6d95da9b4da3f7fc Mon Sep 17 00:00:00 2001 From: Adam King Date: Thu, 17 Nov 2016 09:53:14 -0500 Subject: [PATCH 11/28] Touch README to force a build --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 +# From 27f3716db8d21121f955a9689f2e5536aa1b1e23 Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 18 Nov 2016 13:26:27 -0500 Subject: [PATCH 12/28] deploy to S3 --- .travis.yml | 37 +++++++++++++++++++++++++++---------- bin/copy2S3.sh | 22 ++++++++++++++++++++++ 2 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 bin/copy2S3.sh diff --git a/.travis.yml b/.travis.yml index 8885559..8dd8667 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,19 +30,36 @@ after_success: # - docker run -t webdevops/ansible:alpine-3 ansible --help -deploy: - #provide: ansible? - provider: script - skip_cleanup: true - script: - # - bin/deploy2bm.sh - - bin/moveOver.sh - - 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: shell + skip_cleanup: true + script: + - bin/copy2S3.sh + - provider: s3 + access_key_id: "{{S3_KEY_ID}}" + secret_access_key: "{{S3_KEY}}" + bucket: "{{S3_BUCKET}}" + skip_cleanup: true + region: "us-standard" + local_dir: s3 + # - provider: shell + # + on: + branch: testTravis diff --git a/bin/copy2S3.sh b/bin/copy2S3.sh new file mode 100644 index 0000000..28814d7 --- /dev/null +++ b/bin/copy2S3.sh @@ -0,0 +1,22 @@ +#!/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" + +#Copy over artifacts +tar -cvzf jesse.tar -X .tarignore . +mkdir s3 +mv jesse.tar s3 From 01e83e7437bf1734a6f495f236c2be6272f8d9f0 Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 18 Nov 2016 13:32:06 -0500 Subject: [PATCH 13/28] s3 dir updates --- .travis.yml | 2 +- bin/copy2S3.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8dd8667..6db7fff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,7 +58,7 @@ deploy: bucket: "{{S3_BUCKET}}" skip_cleanup: true region: "us-standard" - local_dir: s3 + local_dir: ./s3 # - provider: shell # on: diff --git a/bin/copy2S3.sh b/bin/copy2S3.sh index 28814d7..60a8fe9 100644 --- a/bin/copy2S3.sh +++ b/bin/copy2S3.sh @@ -20,3 +20,6 @@ echo "Created app.yml" tar -cvzf jesse.tar -X .tarignore . mkdir s3 mv jesse.tar s3 + +pwd +ls -la s3 From 4194e7b674880533dc774c4fac45f0e5df26c464 Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 18 Nov 2016 13:35:22 -0500 Subject: [PATCH 14/28] make .sh +x --- bin/copy2S3.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 bin/copy2S3.sh diff --git a/bin/copy2S3.sh b/bin/copy2S3.sh old mode 100644 new mode 100755 From a29d18a35415b9506b7bfa341d5c9bf5858fff0c Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 18 Nov 2016 13:40:31 -0500 Subject: [PATCH 15/28] tar onbranch testTravis --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6db7fff..b92f789 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,6 +52,8 @@ deploy: skip_cleanup: true script: - bin/copy2S3.sh + on: + branch: testTravis - provider: s3 access_key_id: "{{S3_KEY_ID}}" secret_access_key: "{{S3_KEY}}" From d707b8d7c031e01c2101f0ddfacb30a11e43f933 Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 18 Nov 2016 13:44:17 -0500 Subject: [PATCH 16/28] use shell provider --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b92f789..4f36703 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,7 +48,7 @@ after_success: # irc: "irc.freenode.org#travis" deploy: - - provider: shell + - provider: script skip_cleanup: true script: - bin/copy2S3.sh @@ -61,7 +61,7 @@ deploy: skip_cleanup: true region: "us-standard" local_dir: ./s3 - # - provider: shell + # - provider: script # on: branch: testTravis From 6be8c844d65bd8dbdca287fbbb1a8c9edc7d5943 Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 18 Nov 2016 14:58:19 -0500 Subject: [PATCH 17/28] try US-Standard --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4f36703..2bb67be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,7 +59,7 @@ deploy: secret_access_key: "{{S3_KEY}}" bucket: "{{S3_BUCKET}}" skip_cleanup: true - region: "us-standard" + region: "US-Standard" local_dir: ./s3 # - provider: script # From 685ad2754e35297874193048fab4695d5ea3e1e1 Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 18 Nov 2016 15:01:49 -0500 Subject: [PATCH 18/28] try no S3 region --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2bb67be..b9e5366 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,8 +59,7 @@ deploy: secret_access_key: "{{S3_KEY}}" bucket: "{{S3_BUCKET}}" skip_cleanup: true - region: "US-Standard" - local_dir: ./s3 + local_dir: ./s3 # - provider: script # on: From c84dde9b9e8aa2e36f2850cf68b20604ff76e506 Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 18 Nov 2016 15:03:18 -0500 Subject: [PATCH 19/28] try us-west-2 region --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b9e5366..3f9c9e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,7 +59,8 @@ deploy: secret_access_key: "{{S3_KEY}}" bucket: "{{S3_BUCKET}}" skip_cleanup: true - local_dir: ./s3 + region: "us-west-2" + local_dir: ./s3 # - provider: script # on: From f5f525b20c203d5c0270a9abdcd9a51d5d2e820d Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 18 Nov 2016 17:33:05 -0500 Subject: [PATCH 20/28] Use default env vars for keys --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3f9c9e8..d22b9e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,9 +55,7 @@ deploy: on: branch: testTravis - provider: s3 - access_key_id: "{{S3_KEY_ID}}" - secret_access_key: "{{S3_KEY}}" - bucket: "{{S3_BUCKET}}" + bucket: "thetodd" skip_cleanup: true region: "us-west-2" local_dir: ./s3 From 62411e87d93c04b18ba9bf579d2db699843a29dd Mon Sep 17 00:00:00 2001 From: Adam King Date: Mon, 21 Nov 2016 10:24:30 -0500 Subject: [PATCH 21/28] use default region --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d22b9e6..449f674 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,7 +57,6 @@ deploy: - provider: s3 bucket: "thetodd" skip_cleanup: true - region: "us-west-2" local_dir: ./s3 # - provider: script # From d8ef0251db08557a0b719491e5f0d82838b1466d Mon Sep 17 00:00:00 2001 From: Adam King Date: Mon, 21 Nov 2016 11:09:14 -0500 Subject: [PATCH 22/28] stub out afterdeploy --- .travis.yml | 3 +++ bin/afterDeploy.sh | 3 +++ bin/copy2S3.sh | 1 + 3 files changed, 7 insertions(+) create mode 100755 bin/afterDeploy.sh diff --git a/.travis.yml b/.travis.yml index 449f674..5000016 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,3 +62,6 @@ deploy: # on: branch: testTravis + +after_deploy: + - bin/afterDeploy.sh 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 index 60a8fe9..c6182ec 100755 --- a/bin/copy2S3.sh +++ b/bin/copy2S3.sh @@ -16,6 +16,7 @@ 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 From 48b75238d1e6b22afec05a9b8d19a8886471f424 Mon Sep 17 00:00:00 2001 From: Adam King Date: Mon, 21 Nov 2016 11:41:04 -0500 Subject: [PATCH 23/28] enclose default region --- bin/copy2S3.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/copy2S3.sh b/bin/copy2S3.sh index c6182ec..40f05f5 100755 --- a/bin/copy2S3.sh +++ b/bin/copy2S3.sh @@ -16,7 +16,7 @@ echo "manifest_path: manifest.yml" >> app.yml echo "" >> app.yml echo "Created app.yml" -echo "deploy to $AWS_DEFAULT_REGION" +echo "deploy to ...$AWS_DEFAULT_REGION..." #Copy over artifacts tar -cvzf jesse.tar -X .tarignore . mkdir s3 From afaf73ec7fe47efd328bf72f3df2312d403a701f Mon Sep 17 00:00:00 2001 From: Adam King Date: Mon, 21 Nov 2016 11:43:21 -0500 Subject: [PATCH 24/28] enclose default region 2 --- bin/copy2S3.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/copy2S3.sh b/bin/copy2S3.sh index 40f05f5..ba90685 100755 --- a/bin/copy2S3.sh +++ b/bin/copy2S3.sh @@ -17,6 +17,7 @@ echo "" >> app.yml echo "Created app.yml" echo "deploy to ...$AWS_DEFAULT_REGION..." + #Copy over artifacts tar -cvzf jesse.tar -X .tarignore . mkdir s3 From 68e197573644c8632d952fb91ccce848ab43b480 Mon Sep 17 00:00:00 2001 From: Adam King Date: Mon, 21 Nov 2016 15:21:27 -0500 Subject: [PATCH 25/28] add taskbook --- taskbook.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 taskbook.yml 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}}" From 0980a7ea8fa5ca6f3e4a5b36602d5750e1efb349 Mon Sep 17 00:00:00 2001 From: Adam King Date: Mon, 21 Nov 2016 15:38:42 -0500 Subject: [PATCH 26/28] kickoff deployment --- .travis.yml | 8 +++++- bin/moveOver.sh | 74 ++++++++++++++++++++++++------------------------- 2 files changed, 44 insertions(+), 38 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5000016..ff2973b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,6 +54,7 @@ deploy: - bin/copy2S3.sh on: branch: testTravis + - provider: s3 bucket: "thetodd" skip_cleanup: true @@ -62,6 +63,11 @@ deploy: # on: branch: testTravis - + - provider: script + skip_cleanup: true + script: + - bin/moveOver.sh + on: + branch: testTravis after_deploy: - bin/afterDeploy.sh diff --git a/bin/moveOver.sh b/bin/moveOver.sh index 5dacb1f..04edb3c 100755 --- a/bin/moveOver.sh +++ b/bin/moveOver.sh @@ -1,42 +1,42 @@ #!/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" +# 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 #run node app From 96136cb3d42b00293ca00f1e30c73224a64430e6 Mon Sep 17 00:00:00 2001 From: Adam King Date: Mon, 28 Nov 2016 15:04:04 -0500 Subject: [PATCH 27/28] force rebuild --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ff2973b..e5f2023 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,6 @@ node_js: # services: # - docker - before_install: #Install cloudfoundry - bash bin/setup.sh From 54249e87a0b08755fed78430fce995bd031d96fd Mon Sep 17 00:00:00 2001 From: Adam King Date: Mon, 28 Nov 2016 15:14:04 -0500 Subject: [PATCH 28/28] use alternate towerTalker branch --- bin/moveOver.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/moveOver.sh b/bin/moveOver.sh index 04edb3c..9504f05 100755 --- a/bin/moveOver.sh +++ b/bin/moveOver.sh @@ -38,7 +38,8 @@ # 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 https://github.com/jcantosz/towerTalker.git +git clone -b tarballs https://github.com/jcantosz/towerTalker.git #run node app cd towerTalker