Skip to content

Commit 9418940

Browse files
committed
dockerize
1 parent f62ce86 commit 9418940

File tree

2 files changed

+98
-6
lines changed

2 files changed

+98
-6
lines changed

.travis.yml

Lines changed: 70 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,74 @@
1+
sudo: required
2+
services:
3+
- docker
4+
env:
5+
global:
6+
# Ensure the install happens without prompts
7+
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
18
language: node_js
29
node_js:
3-
- "6"
10+
- '6'
11+
before_install:
12+
- echo "Cloudboost Docs"
13+
- curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
14+
- chmod +x ./kubectl
15+
- sudo mv ./kubectl /usr/local/bin/kubectl
416
install:
5-
- npm install
17+
- sudo apt-get update
18+
- sudo apt-get install curl libc6 libcurl3 zlib1g
19+
- npm install
20+
after_success:
21+
# Build Docker Images
22+
- docker build -t cloudboost/docs:2.0.$TRAVIS_BUILD_NUMBER .
23+
- if [ "$TRAVIS_BRANCH" == "master" ]; then
24+
docker build -t cloudboost/docs:latest .;
25+
fi
26+
# Docker Deploy for staging builds
27+
- if [ "$TRAVIS_BRANCH" == "staging" ]; then
28+
docker build -t cloudboost/docs:staging .;
29+
docker login --username $DOCKERUSERNAME --password $DOCKERPASSWORD --email $DOCKEREMAIL;
30+
docker push cloudboost/docs:staging;
31+
git clone https://github.com/CloudBoost/kube-cred.git;
32+
cd kube-cred;
33+
openssl enc -in config.enc -out config -d -aes256 -k $KUBE_ENC;
34+
mkdir ~/.kube;
35+
mv config ~/.kube/;
36+
kubectl rolling-update cloudboost-docs-staging --image=cloudboost/docs:staging --image-pull-policy=Always;
37+
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/""$cloudflare_zone""/purge_cache" -H "X-Auth-Email:[email protected]" -H "X-Auth-Key:""$cloud_flare_key" -H "Content-Type:application/json" --data "{'purge_everything':true}";
38+
fi
39+
before_deploy:
40+
- git config --global user.email "[email protected]"
41+
- git config --global user.name "Travis CI"
42+
- export GIT_TAG=2.0.$TRAVIS_BUILD_NUMBER
43+
- git tag $GIT_TAG -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER"
44+
- git push -q https://[email protected]/CloudBoost/docs --tags
45+
- ls -R
646
deploy:
7-
provider: azure_web_apps
8-
username: "$azure_deployment_user"
9-
password: "$azure_deployment_password"
10-
site: "$azure_deployment_sitename"
47+
provider: releases
48+
api_key: $GH_TOKEN
49+
file: "README.md"
50+
skip_cleanup: true
51+
on:
52+
tags: false
53+
branch: master
54+
after_deploy:
55+
# Docker Deploy.
56+
- if [ "$TRAVIS_BRANCH" == "master" ]; then
57+
docker login --username $DOCKERUSERNAME --password $DOCKERPASSWORD --email $DOCKEREMAIL;
58+
docker push cloudboost/docs:2.0.$TRAVIS_BUILD_NUMBER;
59+
docker push cloudboost/docs:latest;
60+
git clone https://github.com/CloudBoost/kube-cred.git;
61+
cd kube-cred;
62+
openssl enc -in config.enc -out config -d -aes256 -k $KUBE_ENC;
63+
mkdir ~/.kube;
64+
mv config ~/.kube/;
65+
kubectl rolling-update cloudboost-docs --image=cloudboost/docs:latest --image-pull-policy=Always;
66+
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/""$cloudflare_zone""/purge_cache" -H "X-Auth-Email:[email protected]" -H "X-Auth-Key:""$cloud_flare_key" -H "Content-Type:application/json" --data "{'purge_everything':true}";
67+
fi
68+
branches:
69+
except:
70+
- /^*-v[0-9]/
71+
#Notify Team on Slack
72+
notifications:
73+
slack: cloudboost:gm7nWJDLDtBRyF75VKLKOoMW
74+

Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# CloudBoost Dcos Dockerfile
3+
#
4+
5+
# Pull base image nodejs image.
6+
FROM node:boron
7+
8+
#Maintainer.
9+
MAINTAINER Nawaz Dhandala <[email protected]>
10+
11+
12+
RUN mkdir -p /usr/src/app
13+
14+
WORKDIR /usr/src/app
15+
16+
# Install app dependencies
17+
COPY package.json /usr/src/app/
18+
RUN npm install
19+
20+
# Bundle app source
21+
COPY . /usr/src/app
22+
23+
# Expose ports.
24+
# - 1445: CloudBoost Dcos
25+
EXPOSE 1445
26+
27+
#Run the app
28+
CMD [ "npm", "start" ]

0 commit comments

Comments
 (0)