diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..448dae78 Binary files /dev/null and b/.DS_Store differ diff --git a/README.md b/README.md index e879ebf5..03962722 100644 --- a/README.md +++ b/README.md @@ -6,15 +6,14 @@ This application uses the `node` container obtained from the [Docker Hub](https://hub.docker.com/_/node/) ## Setup -lone this repo and cd into the directory: +Clone this repo and cd into the directory: ``` -git clone https://github.com/wercker/getting-started-nodejs.git +git clone https://github.com/devtron-labs/getting-started-nodejs cd getting-started-nodejs ``` -## Running -You can run the sample app in a couple of different ways. The first is to simply launch the executable: +You can run the sample app while executing this command - ``` node app.js ``` @@ -39,6 +38,59 @@ and then refresh your browser pointing to `http://localhost:8080` to see: {"cities":["Amsterdam","Berlin","New York","San Francisco","Tokyo","London"]}} ``` +## Getting started with deploying application through Devtron + +Lets see how to deploy a custom nodejs app through Devtron. +Make sure Global Configurations are successfully saved and validated before deploying your application. + +**STEP 1** +Login into your Devtron Dashboard, Go to >> Applications >> Create new App. Give an appropriate name to this App, choose the project in which you want to keep the app, and create it. + +**STEP 2** +After creating the app, setup the configurations. Copy the repo URL https://github.com/devtron-labs/getting-started-nodejs and paste it the Git repo section of your App. Click save and move to next config. + +**STEP 3** +Now choose your Docker build config, the repository where you want to keep your CI build image. Select the container registry from the drop-down. + +**STEP 4** +Coming up next is configuring the deployment template. As this is a very simple nodejs application we will be only covering the required the configs. +``` +ContainerPort : + port : 8080 + servicePort : 80 +``` +`8080` is the port number on which my nodejs application is running. + +Now, select the serviceType, keep it as `LoadBalancer`. + +``` +service: + type: LoadBalancer +``` + +**STEP 5** +Now, create a CI/CD workflow for deploying this application. Select the type of pipeline & you can also add “Pre-build” “Post-build” & "Docker build" stages as well. Next add your CD pipeline, by choosing in which environment you want to deploy your app in. + +**STEP 6** +You can add or create secrets or configmaps as per your requirement. These values will be automatically mounted with pods and made available as volumes or as env variables as per your selection. + +**STEP 7** +That’s it, now trigger your CI pipeline by selecting the latest image and deploy it on your chosen project. + +**STEP 8** +After the successful deployment, check out your service manifest for fetching the LoadBalancer URL from the dashboard present in the App Details section. + +![](/gifs/fetching_loadbalancer.gif) + +**STEP 9** +Use this URL on your browser and you can get the output as. + +``` +{"cities":["Amsterdam","Berlin","New York","San Francisco","Tokyo"]} +``` + +Find out a detailed documentation about the configurations from here - https://docs.devtron.ai/devtron/user-guide/creating-application + --- Sign up for Wercker: http://www.wercker.com diff --git a/azure-pipelines-1.yml b/azure-pipelines-1.yml deleted file mode 100644 index 975c52d4..00000000 --- a/azure-pipelines-1.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Node.js -# Build a general Node.js project with npm. -# Add steps that analyze code, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript - -trigger: -- master - -pool: - vmImage: 'ubuntu-latest' - -steps: -- task: NodeTool@0 - inputs: - versionSpec: '10.x' - displayName: 'Install Node.js' - -- script: | - npm install - npm run build - displayName: 'npm install and build' diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 975c52d4..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Node.js -# Build a general Node.js project with npm. -# Add steps that analyze code, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript - -trigger: -- master - -pool: - vmImage: 'ubuntu-latest' - -steps: -- task: NodeTool@0 - inputs: - versionSpec: '10.x' - displayName: 'Install Node.js' - -- script: | - npm install - npm run build - displayName: 'npm install and build' diff --git a/devtron-ci.yaml b/devtron-ci.yaml deleted file mode 100644 index 1023ddfc..00000000 --- a/devtron-ci.yaml +++ /dev/null @@ -1,56 +0,0 @@ -version: 0.0.1 -pipelineConf: - - appliesTo: - - type: BRANCH_FIXED - value: - - master - - type: TAG_PATTERN - value: - - "%d.%d.%d-rc" - - ".*-rc" - beforeDockerBuildStages: - - name: "test-1" - script: | - date > test.report - echo 'hello' - outputLocation: "./test.report" - - name: "test-2" - script: | - date > test2.report - outputLocation: "./test2.report" - afterDockerBuildStages: - - name: "test-3" - script: | - date > test3.report - echo 'hello' - outputLocation: "./test3.report" - - name: "test-4" - script: | - date > test4.report - outputLocation: "./test4.report" - - name: "test-5" - script: | - apk add lua5.3 - apk add lua5.3-dev - echo 'print("Hello World")' > hello.lua - lua5.3 hello.lua > test5.txt - outputLocation: "./test5.txt" - - appliesTo: - - type: BRANCH_FIXED - value: - - qa - - type: TAG_PATTERN - value: - - "%d.%d.%d-rc" - beforeDockerBuildStages: - - name: "stage2-test-1" - script: | - date > test5.report - echo 'hello' - outputLocation: "./test5.report" - afterDockerBuildStages: - - name: "stage2-test-2" - script: | - date > test6.report - echo 'hello' - outputLocation: "./test6.report" diff --git a/gifs/.DS_Store b/gifs/.DS_Store new file mode 100644 index 00000000..81b49a81 Binary files /dev/null and b/gifs/.DS_Store differ diff --git a/gifs/fetching_loadbalancer.gif b/gifs/fetching_loadbalancer.gif new file mode 100644 index 00000000..751bf042 Binary files /dev/null and b/gifs/fetching_loadbalancer.gif differ