Skip to content

Commit

Permalink
Fix deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
solocommand committed Apr 2, 2019
1 parent f23136a commit e330aa7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
FROM node:10.15

ENV NODE_ENV production
ENV PORT 80
ENV EXPOSED_PORT 80

WORKDIR /root
ENTRYPOINT [ "node", "src/index.js" ]

ADD ./ /root
RUN yarn --production
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@base-cms/body-import-parser",
"version": "0.1.0",
"version": "0.1.1",
"main": "src/index.js",
"repository": "https://github.com/base-cms/body-import-parser.git",
"author": "Jacob Bare <[email protected]>",
Expand Down
11 changes: 4 additions & 7 deletions scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
* Deployment tool for project
* Requirements:
* - ENV
* - DOCKERHUB_USERNAME
* - DOCKERHUB_PASSWORD
* - DOCKER_USERNAME
* - DOCKER_PASSWORD
* - TRAVIS_TAG
* - RANCHER_URL
* - RANCHER_TOKEN
* - RANCHER_CLUSTERID
*/

const { existsSync } = require('fs');
const { join } = require('path');
const { spawnSync } = require('child_process');
const https = require('https');
const lerna = require('../lerna.json');

const { log } = console;
const { TRAVIS_TAG: version } = process.env;
Expand Down Expand Up @@ -77,13 +74,13 @@ const shouldBuild = async () => {
*/
const build = async () => {
log(`Building ${image}:${version}...\n`);
const { status } = await spawnSync('bash', ['scripts/deploy-image.sh', site, version], { stdio: 'inherit' });
const { status } = await spawnSync('bash', ['scripts/deploy-image.sh', version], { stdio: 'inherit' });
if (status !== 0) error('Image build failed!');
}

const deploy = async () => {
log(`Deploying ${image}:${version} on Kubernertes`);
const { status } = await spawnSync('bash', ['scripts/deploy-k8s.sh', site, version], { stdio: 'inherit' });
const { status } = await spawnSync('bash', ['scripts/deploy-k8s.sh', version], { stdio: 'inherit' });
if (status !== 0) error('Image deploy failed!');
};

Expand Down

0 comments on commit e330aa7

Please sign in to comment.