Skip to content

Instantly share code, notes, and snippets.

View dennisotugo's full-sized avatar
🎯
Focusing

Dennis W. Otugo dennisotugo

🎯
Focusing
View GitHub Profile
Output
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
-------------------------------------------------------------------------------
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):
Output
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/example.com/fullchain.pem. Your cert will
expire on 2017-10-23. To obtain a new or tweaked version of this
certificate in the future, simply run certbot again with the
"certonly" option. To non-interactively renew *all* of your
certificates, run "certbot renew"
- Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
after_success:
- chmod +x ./push.sh
- ./push.sh
#!/bin/bash
# add the commit info to the commit message
rev=$(git rev-parse --short HEAD)
# sets an email for the git
git config --global user.email "travis@travis-ci.org"
# sets a username for the git
git config --global user.name "Travis CI"
# makes a git clone of the master branch
git clone -b master https://dennisotugo:${AUTOBUILD_TOKEN}@github.com/HNGInternship/HNGFun master
# makes a git clone of the prod branch
$ git config --global user.name "[Travis CI]"
$ git config --global user.email "[your github email]"
$ ssh username@localhost
$ mkdir /var/www/HNGFun
$ sudo chown -R username:username /var/www/HNGFun
$ git clone git@github.com/HNGInternship/HNGFun.git /var/www/HNGFun
$ cd /var/www/HNGFun
$ cd /var/www/HNGFun
$ touch deploy.php
$ sudo apt install nano
$ nano deploy.php
<?php
/**
* GIT DEPLOYMENT SCRIPT
*
* Used for automatically deploying websites via GitHub
*
*/
// array of commands
$commands = array(
'echo $PWD',
# vim /etc/nginx/sites-available/hng.fun
server {
listen 80;
listen [::]:80;
root /var/www/roomhub/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name roomhub.hng.fun www.roomhub.hng.fun;
location / {
try_files $uri $uri/ /index.php?$query_string;
#vim /etc/nginx/sites-available/hng.fun
server {
root /var/www/HNGFun;
index index.php index.html index.htm;
server_name hng.fun www.hng.fun;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {