retire jenkins
parent
15fc49d828
commit
ee954b7f47
|
@ -1,24 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# this script is used by jenkins to remotely update a regluit instance
|
|
||||||
# for it to work the jenkins user's public ssh key needs to be in the
|
|
||||||
# authorized key for the machine running the regluit instance
|
|
||||||
# you can then put something like this in a post build configuration
|
|
||||||
# ssh ubuntu@please.unglueit.com "/opt/regluit/deploy/update-regluit"
|
|
||||||
|
|
||||||
cd /opt/regluit
|
|
||||||
find . -name "*.pyc" -delete
|
|
||||||
find . -type d -empty -delete
|
|
||||||
|
|
||||||
sudo -u ubuntu /usr/bin/git pull
|
|
||||||
source ENV/bin/activate
|
|
||||||
pip install --upgrade -r requirements_versioned.pip
|
|
||||||
#django-admin.py syncdb --migrate --settings regluit.settings.just
|
|
||||||
django-admin.py migrate --fake-initial --noinput --settings regluit.settings.just
|
|
||||||
django-admin.py collectstatic --noinput --settings regluit.settings.just
|
|
||||||
|
|
||||||
sudo /etc/init.d/apache2 restart
|
|
||||||
django-admin.py celeryd_multi restart w1 --settings=regluit.settings.just;
|
|
||||||
/etc/init.d/celerybeat restart
|
|
||||||
crontab deploy/crontab_just.txt
|
|
||||||
touch /opt/regluit/deploy/last-update
|
|
|
@ -1,22 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# this script is used by jenkins to remotely update a regluit instance
|
|
||||||
# for it to work the jenkins user's public ssh key needs to be in the
|
|
||||||
# authorized key for the machine running the regluit instance
|
|
||||||
# you can then put something like this in a post build configuration
|
|
||||||
# ssh ubuntu@please.unglueit.com "/opt/regluit/deploy/update-regluit"
|
|
||||||
|
|
||||||
cd /opt/regluit
|
|
||||||
find . -name "*.pyc" -delete
|
|
||||||
find . -type d -empty -delete
|
|
||||||
|
|
||||||
sudo -u ubuntu /usr/bin/git pull
|
|
||||||
source ENV/bin/activate
|
|
||||||
#pip install -r requirements.pip
|
|
||||||
django-admin.py syncdb --migrate --settings regluit.settings.please
|
|
||||||
django-admin.py collectstatic --noinput --settings regluit.settings.please
|
|
||||||
sudo /etc/init.d/apache2 restart
|
|
||||||
django-admin.py celeryd_multi restart w1 --settings=regluit.settings.please;
|
|
||||||
/etc/init.d/celerybeat restart
|
|
||||||
crontab deploy/crontab_please.txt
|
|
||||||
touch /opt/regluit/deploy/last-update
|
|
|
@ -1,56 +0,0 @@
|
||||||
# coding=utf-8
|
|
||||||
from .common import *
|
|
||||||
|
|
||||||
DEBUG = True
|
|
||||||
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
|
|
||||||
IS_PREVIEW = False
|
|
||||||
|
|
||||||
ADMINS = (
|
|
||||||
('Raymond Yee', 'rdhyee+ungluebugs@gluejar.com'),
|
|
||||||
('Eric Hellman', 'eric@gluejar.com'),
|
|
||||||
)
|
|
||||||
|
|
||||||
MANAGERS = ADMINS
|
|
||||||
|
|
||||||
DATABASES = {
|
|
||||||
'default': {
|
|
||||||
'ENGINE': 'django.db.backends.mysql',
|
|
||||||
'NAME': 'regluit',
|
|
||||||
'USER': 'regluit',
|
|
||||||
'PASSWORD': 'regluit',
|
|
||||||
'HOST': '',
|
|
||||||
'PORT': '',
|
|
||||||
'TEST': {
|
|
||||||
'CHARSET': 'utf8',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TIME_ZONE = 'America/New_York'
|
|
||||||
|
|
||||||
# settings for outbout email
|
|
||||||
# if you have a gmail account you can use your email address and password
|
|
||||||
|
|
||||||
EMAIL_USE_TLS = True
|
|
||||||
EMAIL_HOST = 'smtp.gmail.com'
|
|
||||||
EMAIL_HOST_USER = 'me@gmail.com'
|
|
||||||
EMAIL_HOST_PASSWORD = 'my-password'
|
|
||||||
EMAIL_PORT = 587
|
|
||||||
DEFAULT_FROM_EMAIL = 'info@ebookfoundation.org'
|
|
||||||
|
|
||||||
|
|
||||||
# formerly of settings/common.py to surface old vars
|
|
||||||
# TO DO: invalidate before we open source
|
|
||||||
|
|
||||||
# for use with test google account only
|
|
||||||
GOOGLE_DISPLAY_NAME = 'Unglue.It'
|
|
||||||
REDIRECT_IS_HTTPS = False
|
|
||||||
|
|
||||||
#BASE_URL = 'http://0.0.0.0/'
|
|
||||||
BASE_URL_SECURE = 'http://0.0.0.0/'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# use database as queuing service in development
|
|
||||||
BROKER_TRANSPORT = "djkombu.transport.DatabaseTransport"
|
|
||||||
#INSTALLED_APPS += ("djkombu",)
|
|
|
@ -2,5 +2,4 @@
|
||||||
just ansible_ssh_port=22 ansible_ssh_host=just.unglue.it ansible_ssh_user=ubuntu
|
just ansible_ssh_port=22 ansible_ssh_host=just.unglue.it ansible_ssh_user=ubuntu
|
||||||
web1 ansible_ssh_port=22 ansible_ssh_host=unglue.it ansible_ssh_user=ubuntu
|
web1 ansible_ssh_port=22 ansible_ssh_host=unglue.it ansible_ssh_user=ubuntu
|
||||||
gluejar ansible_ssh_port=22 ansible_ssh_host=gluejar.com ansible_ssh_user=ubuntu
|
gluejar ansible_ssh_port=22 ansible_ssh_host=gluejar.com ansible_ssh_user=ubuntu
|
||||||
jenkins ansible_ssh_port=22 ansible_ssh_host=jenkins.unglueit.com ansible_ssh_user=ubuntu
|
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
# ansible.inventory_path = '.vagrant/provisioners/ansible/inventory/'
|
# ansible.inventory_path = '.vagrant/provisioners/ansible/inventory/'
|
||||||
ansible.raw_arguments = [
|
ansible.raw_arguments = [
|
||||||
"--inventory-file=.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory",
|
"--inventory-file=.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory",
|
||||||
"--limit=just,127.0.0.1,jenkins",
|
"--limit=just,127.0.0.1",
|
||||||
"-e vname=just",
|
"-e vname=just",
|
||||||
"-e class=just",
|
"-e class=just",
|
||||||
"-e hostname=just.unglue.it",
|
"-e hostname=just.unglue.it",
|
||||||
|
@ -186,7 +186,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
# ansible.inventory_path = '.vagrant/provisioners/ansible/inventory/'
|
# ansible.inventory_path = '.vagrant/provisioners/ansible/inventory/'
|
||||||
ansible.raw_arguments = [
|
ansible.raw_arguments = [
|
||||||
"--inventory-file=.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory",
|
"--inventory-file=.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory",
|
||||||
"--limit=just2,127.0.0.1,jenkins",
|
"--limit=just2,127.0.0.1",
|
||||||
"-e vname=just2",
|
"-e vname=just2",
|
||||||
"-e class=just",
|
"-e class=just",
|
||||||
"-e hostname=just2.unglue.it",
|
"-e hostname=just2.unglue.it",
|
||||||
|
|
|
@ -499,13 +499,6 @@
|
||||||
- https://github.com/eshellman.keys
|
- https://github.com/eshellman.keys
|
||||||
sudo: no
|
sudo: no
|
||||||
|
|
||||||
- name: add public key from jenkins
|
|
||||||
authorized_key: >
|
|
||||||
user={{user}}
|
|
||||||
key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYSiXESHXEdugNLGxFABXpVSawDCU/BK05Ef2qUa7oxxhU7fXNqWaSTqowevVruF7kfzMQ7epIxN5XFFjbXf/tsSn1995H9BEhmHLXLuEB5VaPU2HTLqu0DscyPtRbk/WjqPj3jWXs2yHgKcJIXwd5EfSwJuCe1Ut6pMe9E/NUq9QztnydRTt0sGywXpkIpKeBkiQl4SWlPTHcoU6PDbEuMVii8GzRAQlpEQTJwzWJTToR1SZ7o1uusDSxIDfJSvAa5IiuII8CdKbqa/JSx1+4LqlT0yf+2yb67MR5q6+XFM4TeCf5z+4SW+IT/wd2tpbd0DjAdXJlAgBULwhd1L7r"
|
|
||||||
state=present
|
|
||||||
when: class in ['just']
|
|
||||||
|
|
||||||
- name: set up script file to load environment for interactive use
|
- name: set up script file to load environment for interactive use
|
||||||
command: cp "/opt/regluit/deploy/setup-{{class}}.sh" /home/{{user}}/setup.sh
|
command: cp "/opt/regluit/deploy/setup-{{class}}.sh" /home/{{user}}/setup.sh
|
||||||
sudo: no
|
sudo: no
|
||||||
|
@ -549,29 +542,4 @@
|
||||||
service: name=apache2 state=restarted
|
service: name=apache2 state=restarted
|
||||||
|
|
||||||
|
|
||||||
- name: fix known_hosts on jenkins to match new just
|
|
||||||
hosts: jenkins
|
|
||||||
sudo: yes
|
|
||||||
sudo_user: jenkins
|
|
||||||
|
|
||||||
# to run the part of the playbook for jenkins
|
|
||||||
# PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --private-key=/Users/raymondyee/.ssh/id_rsa --user=ubuntu --connection=ssh --inventory-file=/Users/raymondyee/C/src/Gluejar/regluit/vagrant/.vagrant/provisioners/ansible/inventory --limit='jenkins' just.yml
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
|
|
||||||
#equivalent to
|
|
||||||
#
|
|
||||||
#ssh -tt jenkins << EOF
|
|
||||||
# sudo -i -u jenkins
|
|
||||||
# ssh-keyscan -t rsa just.unglue.it > /var/lib/jenkins/.ssh/known_hosts
|
|
||||||
# exit
|
|
||||||
#exit
|
|
||||||
#EOF
|
|
||||||
|
|
||||||
- name: make new known_hosts with key from just.unglue.it
|
|
||||||
raw: ssh-keyscan -t rsa just.unglue.it > /var/lib/jenkins/.ssh/known_hosts
|
|
||||||
when: class in ['just']
|
|
||||||
|
|
||||||
- name: add key from github
|
|
||||||
raw: ssh-keyscan -t rsa github.com >> /var/lib/jenkins/.ssh/known_hosts
|
|
||||||
when: class in ['just']
|
|
||||||
|
|
|
@ -384,41 +384,12 @@
|
||||||
- https://github.com/eshellman.keys
|
- https://github.com/eshellman.keys
|
||||||
sudo: yes
|
sudo: yes
|
||||||
|
|
||||||
- name: add public key from jenkins
|
|
||||||
authorized_key: >
|
|
||||||
user={{user}}
|
|
||||||
key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYSiXESHXEdugNLGxFABXpVSawDCU/BK05Ef2qUa7oxxhU7fXNqWaSTqowevVruF7kfzMQ7epIxN5XFFjbXf/tsSn1995H9BEhmHLXLuEB5VaPU2HTLqu0DscyPtRbk/WjqPj3jWXs2yHgKcJIXwd5EfSwJuCe1Ut6pMe9E/NUq9QztnydRTt0sGywXpkIpKeBkiQl4SWlPTHcoU6PDbEuMVii8GzRAQlpEQTJwzWJTToR1SZ7o1uusDSxIDfJSvAa5IiuII8CdKbqa/JSx1+4LqlT0yf+2yb67MR5q6+XFM4TeCf5z+4SW+IT/wd2tpbd0DjAdXJlAgBULwhd1L7r"
|
|
||||||
state=present
|
|
||||||
sudo: no
|
|
||||||
|
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- name: restart apache2
|
- name: restart apache2
|
||||||
service: name=apache2 state=restarted
|
service: name=apache2 state=restarted
|
||||||
|
|
||||||
- name: fix known_hosts on jenkins to match new just
|
|
||||||
hosts: jenkins
|
|
||||||
sudo: yes
|
|
||||||
sudo_user: jenkins
|
|
||||||
|
|
||||||
# to run the part of the playbook for jenkins
|
|
||||||
# PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --private-key=/Users/raymondyee/.ssh/id_rsa --user=ubuntu --connection=ssh --inventory-file=/Users/raymondyee/C/src/Gluejar/regluit/vagrant/.vagrant/provisioners/ansible/inventory --limit='jenkins' just.yml
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
|
|
||||||
#equivalent to
|
|
||||||
#
|
|
||||||
#ssh -tt jenkins << EOF
|
|
||||||
# sudo -i -u jenkins
|
|
||||||
# ssh-keyscan -t rsa just.unglue.it > /var/lib/jenkins/.ssh/known_hosts
|
|
||||||
# exit
|
|
||||||
#exit
|
|
||||||
#EOF
|
|
||||||
|
|
||||||
- name: make new known_hosts with key from just.unglue.it
|
|
||||||
raw: ssh-keyscan -t rsa just.unglue.it > /var/lib/jenkins/.ssh/known_hosts
|
|
||||||
|
|
||||||
- name: add key from github
|
|
||||||
raw: ssh-keyscan -t rsa github.com >> /var/lib/jenkins/.ssh/known_hosts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -412,12 +412,6 @@
|
||||||
- https://github.com/eshellman.keys
|
- https://github.com/eshellman.keys
|
||||||
sudo: yes
|
sudo: yes
|
||||||
|
|
||||||
- name: add public key from jenkins
|
|
||||||
authorized_key: >
|
|
||||||
user={{user}}
|
|
||||||
key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYSiXESHXEdugNLGxFABXpVSawDCU/BK05Ef2qUa7oxxhU7fXNqWaSTqowevVruF7kfzMQ7epIxN5XFFjbXf/tsSn1995H9BEhmHLXLuEB5VaPU2HTLqu0DscyPtRbk/WjqPj3jWXs2yHgKcJIXwd5EfSwJuCe1Ut6pMe9E/NUq9QztnydRTt0sGywXpkIpKeBkiQl4SWlPTHcoU6PDbEuMVii8GzRAQlpEQTJwzWJTToR1SZ7o1uusDSxIDfJSvAa5IiuII8CdKbqa/JSx1+4LqlT0yf+2yb67MR5q6+XFM4TeCf5z+4SW+IT/wd2tpbd0DjAdXJlAgBULwhd1L7r"
|
|
||||||
state=present
|
|
||||||
|
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- name: restart apache2
|
- name: restart apache2
|
||||||
|
|
Loading…
Reference in New Issue