Skip to content

Commit 4470a05

Browse files
committed
Merge commit 'deployment before https' into deployment-install
2 parents 415226c + 68527fc commit 4470a05

File tree

3 files changed

+57
-35
lines changed

3 files changed

+57
-35
lines changed

PROVISIONING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Current deployment method
2+
3+
The deployment is triggered when something is pushed on [deployment](https://github.com/coderbunker/inventory-server/tree/deployment) branch using [codeship](http://codeship.com/).
4+
5+
The server hosting the deployment runs the webapp using pm2 as suggested in [this tutorial](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04).
6+
7+
pm2 uses [process.yml](https://github.com/coderbunker/inventory-server/blob/deployment/process.yml) configuration file.
8+
9+
The hosting itself works with an nginx service forwarding the requests to the local web application.
10+
11+
12+
## Codeship administration
13+
Once you are listed in the [project owners](https://app.codeship.com/orgs/coderbunker/teams/owners) you can:
14+
* see deployments history: [Codeship dashboard](https://app.codeship.com/projects/261737)
15+
* manage deployment scripts [Codeship administration page](https://app.codeship.com/projects/261737/deployment_branches/187689)
16+
17+
18+
# How to prepare the host
19+
20+
#### Allow host's ssh keys to access this repository
21+
The host needs to have read access on this reposit to download the deployment branch.
22+
23+
Add the ssh keys of the new host (the content of the file: ~/.ssh/id_rsa.pub) on the "[Deploy keys section](https://github.com/coderbunker/inventory-server/settings/keys)".
24+
25+
Before the first deployment, the reposit has to be downloaded and the deployment branch must be checkout.
26+
27+
git clone [email protected]:coderbunker/inventory-server.git
28+
cd inventory-server
29+
git checkout deployment
30+
31+
#### Install hosting programs
32+
If you choose to use pm2 + nginx to monitor application, they have to be installed separately (their installation is not triggered by 'npm install').

README.md

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,25 @@ http://127.0.0.1:1234/
1616

1717
Try also
1818
http://127.0.0.1:1234/search
19+
20+
## Troobleshooting.
21+
If the application is not starting, check that if there is any application already using port 1234.
22+
It is also possible that the previous time that "inventory-server" had been lauched did not termniate properly and it is still holding the port.
23+
24+
# Other information:
25+
The content are stored on a google spreadsheet. You need permission to edit:
26+
https://docs.google.com/spreadsheets/d/1QHKa3vUpht7zRl_LEzl3BlUbolz3ZiL8yKHzdBL42dY/edit
27+
28+
# Deployment
29+
30+
## Push to deploy
31+
The website is published on the domain name url.coderbunker.com
32+
33+
The deployment is automatically triggered when something is pushed on the [deployment branch](https://github.com/coderbunker/inventory-server/tree/deployment).
34+
35+
1936
# Contribution
37+
2038
## Use pull request
2139
Avoid pushing straight to the master branch any code that needs review.
2240
Please follow the following steps.
@@ -43,38 +61,3 @@ Please follow the following steps.
4361
git branch -d my_branch #if you don't need that branch anymore you can delete it
4462
## other information
4563
the project is structured around [expressjs](https://github.com/expressjs/express)
46-
# Deploy
47-
To deploy inventory-server you need an account a [heroku account](https://signup.heroku.com/dc?_ga=2.174119140.795848951.1511268290-1509905748.1509873833)
48-
#### - [Install heroku](https://devcenter.heroku.com/articles/getting-started-with-python?c=70130000000NhRJAA0&utm_campaign=Onboarding-Nurture-Email-1&utm_medium=email&utm_source=nurture&utm_content=devcenter&utm_term=start-python#set-up)
49-
#### - Once your installation succeded you can login into your account using heroku's command line:
50-
heroku login
51-
## Prepare your workspace
52-
### Prepare it from scratch
53-
#### - Clone this repository then go to the project folder
54-
git clone https://github.com/coderbunker/inventory-server.git
55-
cd inventory-server
56-
#### - In order to quickly create a new deployment of this repository, create your copy repository hosted in their server: https://git.heroku.com.
57-
You can create one with one command:
58-
Skip this step if you want to manage our deployment.
59-
heroku create #will add a remote repository called 'heroku'(ensure you don't have an existing remote with that name)
60-
### Deploy the code you contributed on
61-
#### - Clone this repository then go to the project folder
62-
git clone https://github.com/coderbunker/inventory-server.git
63-
cd inventory-server
64-
#### - In order to administrate our release you can run the following commands (requires access rights).
65-
git remote add heroku https://git.heroku.com/enigmatic-brushlands-32514.git
66-
67-
### Create a separate repository that tracks the deployment
68-
#### - Or, if you want to work in a dedicated repository you can do this that way
69-
heroku git:clone -a enigmatic-brushlands-32514
70-
cd enigmatic-brushlands-32514
71-
72-
## Release your work
73-
#### - Push the version of the repository you want to deploy on the 'heroku' remote, for instance if you want to deploy your master branch type:
74-
git push heroku master
75-
#No matter the local branch you are pushing, it is recommended to push on heroku remote's master branch
76-
git push heroku my_branch:master #only if you are using a different branch
77-
#### - Finally just deploy the app you just pushed using this command.
78-
heroku ps:scale web=1
79-
80-
Et voilà

process.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apps:
2+
- script : app.js
3+
instances: 1
4+
exec_mode: cluster
5+
name: inventory-server
6+
env:
7+
PORT: 8080

0 commit comments

Comments
 (0)