Skip to content

Commit 49ed574

Browse files
authored
Merge pull request #34 from WorldBank-Transport/develop
Release new version of ram-analysis
2 parents 60ed044 + 11d31b4 commit 49ed574

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ jobs:
8080
command: docker build -t ram-tools ./ram-tools
8181

8282
- run:
83-
name: Build Docker image of ${DOCKER_IMAGE}
83+
name: Build Docker image of ram-vt
8484
command: docker build -t ${DOCKER_IMAGE} ./ram-vt
8585

8686
- run:
8787
name: Tag and push Docker image for ram-vt's stable version
8888
command: |
89-
# Grab version from package.json and prepend with ram-analysis-v (ram-analysis-v0.5.0)
89+
# Grab version from package.json and prepend with ram-vt-v (ram-vt-v0.5.0)
9090
VERSION=v$(grep -m1 version ram-vt/package.json | awk -F: '{ print $2 }' | sed 's/[", ]//g')
9191
9292
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWD
@@ -137,11 +137,11 @@ jobs:
137137
command: docker build -t ram-tools ./ram-tools
138138

139139
- run:
140-
name: Build Docker image of ${DOCKER_IMAGE}
140+
name: Build Docker image of ram-analysis
141141
command: docker build -t ${DOCKER_IMAGE} ./ram-analysis
142142

143143
- run:
144-
name: Tag and push Docker image for ${DOCKER_IMAGE}'s stable version
144+
name: Tag and push Docker image for ram-analysis stable version
145145
command: |
146146
# Grab version from package.json and prepend with ram-analysis-v (ram-analysis-v0.5.0)
147147
VERSION=v$(grep -m1 version ram-analysis/package.json | awk -F: '{ print $2 }' | sed 's/[", ]//g')

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,14 @@ docker build -t ram-tools .
1313
cd ram-analysis
1414
docker build -t ram-analysis .
1515
```
16+
17+
## Releasing a new version
18+
The process to release a new version:
19+
20+
- still on `develop`, bump the version in `./ram-tools/package.json` and/or `./ram-analysis/package.json`
21+
- set up PR, have somebody do a review and merge `develop` into `master`
22+
- CircleCI will add a new tag to git using the version in `package.json`
23+
Because this repo holds two containers that are independently versioned, the git tags are prepended with the container name (eg. `ram-vt-v0.1.0`)
24+
- if the tagging was successful, CircleCI will build the Docker image, tag it with the version number and push it to Docker Hub. If the tagging failed (because the version wasn't updated in `package.json`), the build fails
25+
26+
Once this is done, you can [add a new release on Github](https://github.com/WorldBank-Transport/ram-datapipeline/releases/new) with useful notes that describe it.

ram-analysis/app/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ operationExecutor
173173
.then(() => process.exit(0))
174174
.catch(err => {
175175
console.log('err', err);
176-
let eGroup = logger.group('error');
176+
let eGroup = logger.group('fatal-error');
177177
if (err.message) {
178178
eGroup.log(err.message);
179179
eGroup.log(err.stack);
@@ -183,7 +183,10 @@ operationExecutor
183183
logger.toFile(`${WORK_DIR}/process.log`);
184184
operation.log(opCodes.OP_ERROR, {error: err.message || err})
185185
.then(() => operation.finish())
186-
.then(() => process.exit(1), () => process.exit(1));
186+
.then(() => process.exit(1))
187+
// If it errors again exit.
188+
// This is especially important in the case of DB errors.
189+
.catch(() => process.exit(1));
187190
});
188191

189192
//

ram-analysis/app/s3/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ switch (STORAGE_ENGINE) {
2424
break;
2525
case 's3':
2626
minioClient = new Minio.Client({
27+
// Endpoint gets updated based on region.
2728
endPoint: 's3.amazonaws.com',
29+
region: STORAGE_REGION,
2830
accessKey: STORAGE_ACCESS_KEY,
2931
secretKey: STORAGE_SECRET_KEY
3032
});

ram-analysis/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ram-analysis",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)