Skip to content
This repository has been archived by the owner on Mar 11, 2019. It is now read-only.

Updated development-workflow exercise. Added target to build commands for sudc in the others #39

Open
wants to merge 3 commits into
base: v0.14-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions 3-deploy-larger-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ Build the system
Let's go ahead and build the containers ready for deployment:

```bash
nscale container buildall sudc
nscale container buildall sudc dev
```

Alternatively, you can build all the containers by themselves:

```bash
nscale container build sudc hist
nscale container build sudc real
nscale container build sudc doc
nscale container build sudc web
nscale container build sudc hist dev
nscale container build sudc real dev
nscale container build sudc doc dev
nscale container build sudc web dev
```

After those have all completed we should have four containers ready for deployment.
Expand Down Expand Up @@ -183,6 +183,5 @@ open http://$(boot2docker ip):8000

Linux:
open [localhost:8000](http://localhost:8000)


[Next up: exercise 4](./4-config-&-logs.md)
2 changes: 1 addition & 1 deletion 5-update-&-rollback.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ git commit -m "Added buggy alert"
Build the container and deploy the latest revision:
```bash
nscale system compile sudc development
nscale container build sudc web
nscale container build sudc web development
nscale revision deploy sudc latest development
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the command be dev over development here? it seems the docs have dev in some places, development in others`. Unless there is a reason we should perhaps stick to one convention for docs? @darragh-hayes can you check this? @mcollina can you confirm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A target can be abbreviated, but ok for consistency!
Il giorno gio 26 feb 2015 alle 12:15 Dean McDonnell <
[email protected]> ha scritto:

In 5-update-&-rollback.md
#39 (comment)
:

@@ -38,7 +38,7 @@ git commit -m "Added buggy alert"
Build the container and deploy the latest revision:

 nscale system compile sudc development
-nscale container build sudc web
+nscale container build sudc web development
 nscale revision deploy sudc latest development

Should the command be dev over development here? it seems the docs have
dev in some places, development in others. Unless there is a reason we
should perhaps stick to one convention for docs? @darragh-hayes
https://github.com/darragh-hayes can you check this? @mcollina
https://github.com/mcollina can you confirm?


Reply to this email directly or view it on GitHub
https://github.com/nearform/nscale-workshop/pull/39/files#r25419658.


Expand Down
40 changes: 16 additions & 24 deletions development-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This guide is composed of two sections:
Editing an existing system
--------------------------
It is this workflow which allows us to makes changes and deploy them using nscale:

- Make changes in code
- Commit
- (optional) push to Github
Expand All @@ -42,31 +42,26 @@ nscale sys link .
The system will be set up for local development by issuing:

```bash
nscale sys compile development
nscale sys compile
```

Then, to download and install dependencies, launch:

```bash
nscale cont buildall
nscale cont buildall latest process
```

Finally, to start the system:

```bash
nscale rev dep head development
nscale rev dep head process
```
**Make the Edit**
Pay particular attention to the fact that when building containers nscale, will checkout repos using the sha of the latest commit. This will detach the HEAD your repos. The danger is that you build containers which detaches the HEAD, edit code on an unreferenced branch, and then do a system compile which checks out the master branch in each repo. You could potentially lose work.

**Tip:**
Before writing code that you are building into a container, do a git status of that repo to make sure the HEAD isn't detached or else you will be writing code on an unnamed branch. Checkout to master or another branch before proceeding.

cd into the workspace/sudc-web directory and run a git branch command.
If the HEAD is detached, then do
```bash
git checkout master
```
Open up `workspace/sudc-web/web/public/js/app.js` and add an alert after the 'Your code here' comment:

```js
Expand All @@ -76,23 +71,24 @@ initialize: function () {
}

**cd into the sudc/workspace/sudc-web directory**, stage the changes and commit:
```bash
```bash
git add .
git commit -m "added alert"
```
Compile the system:

Compile the system (from the main system folder):
```bash
nscale sys compile sudc latest development
nscale sys compile
```

build the Web container:
```bash
nscale cont build sudc web
nscale cont build web process
```

redeploy:
```bash
nscale rev deploy sudc latest development
nscale rev deploy sudc latest process
```

<a name="new-system"></a>
Expand Down Expand Up @@ -140,9 +136,7 @@ Then, edit the topology section of `system.js` into:

```js
exports.topology = {
local: {
},
process: {
development: {
root: ['redis']
}
};
Expand All @@ -151,9 +145,9 @@ exports.topology = {
Then, compile and build this topology:

```bash
nsd sys comp process
nsd sys comp
nsd cont buildall
nsd rev dep head
nsd rev dep head dev
```

To check that everything is fine, launch:
Expand Down Expand Up @@ -197,9 +191,7 @@ and edit the topology section of `system.js` into:

```js
exports.topology = {
local: {
},
process: {
development: {
root: ['web', 'redis']
}
};
Expand Down Expand Up @@ -390,8 +382,8 @@ Our little REST key/value store is ready to go!
Go back to your system folder (`cd ../../`) and then run:

```
nsd cont build web
nsd rev dep head
nsd cont build web dev
nsd rev dep head dev
```

And then you can test your little REST server as above!
Expand Down