Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For jenkins #277

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
61 changes: 61 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build and Deploy

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "10"

- name: Install nvm
run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
. ~/.nvm/nvm.sh
nvm install 10
nvm use 10

- name: Install dependencies
run: |
npm i --legacy-peer-deps
npm i --save-dev @types/[email protected] --legacy-peer-deps

- name: Build production
env:
NODE_OPTIONS: --max-old-space-size=4096
run: npm run build:production

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_EMAIL }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Docker image
run: docker build --platform linux/amd64 -t rannybal2024/nimble-frontend-service:${{ github.run_number }} .

- name: Push Docker image
run: docker push rannybal2024/nimble-frontend-service:${{ github.run_number }}

- name: Update Kubernetes deployment with new image
run: |
sed -i 's|IMAGE_TAG|rannybal2024/nimble-frontend-service:${{ github.run_number }}|' kubernetes/deploy.yml

- name: Set up kubeconfig
run: echo "${{ secrets.KUBECONFIG }}" > $HOME/kube-config.yaml

- name: Apply Kubernetes deployment
run: kubectl --kubeconfig=$HOME/kube-config.yaml apply -f kubernetes/deploy.yml

- name: Clean up kubeconfig
run: rm -f $HOME/kube-config.yaml
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM nginx
COPY dist/ /usr/share/nginx/html
70 changes: 37 additions & 33 deletions kubernetes/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,59 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: nimble-platform
labels:
app: nimble-platform
name: frontend-service
nim-prod: frontend-service
name: frontend-service
spec:
replicas: 1
selector:
matchLabels:
app: nimble-platform
name: frontend-service
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
revisionHistoryLimit: 5
nim-prod: frontend-service
template:
metadata:
labels:
app: nimble-platform
name: frontend-service
nim-prod: frontend-service
spec:
imagePullSecrets:
- name: do-registry
containers:
- image: nimbleplatform/frontend-service
imagePullPolicy: Always
name: frontend-service
ports:
- containerPort: 8080
name: http
protocol: TCP
resources:
requests:
cpu: 200m
memory: 256Mi
- env:
- name: CONFIG_SERVER_FAILFAST
value: "true"
- name: CONFIG_SERVER_URI
value: http://config-server:8888
- name: DISCOVERY_ENABLED
value: "true"
- name: DISCOVERY_PREFER_IP
value: "false"
- name: DISCOVERY_SERVER_URI
value: http://service-discovery:8761
- name: LOGSTASH_URI
value: logstash:5000
- name: SPRING_PROFILES_ACTIVE
value: docker
- name: _JAVA_OPTIONS
value: -Xmx512m -Xms50m
image: IMAGE_TAG #assigned on runtime by github-action
imagePullPolicy: Always
name: frontend-service
ports:
- containerPort: 80
restartPolicy: Always

---

apiVersion: v1
kind: Service
metadata:
name: frontend-service
namespace: nimble-platform
labels:
app: nimble-platform
name: frontend-service
nim-prod: frontend-service
name: frontend-service
spec:
ports:
- name: http
protocol: TCP
port: 8080
targetPort: 8080
port: 80
targetPort: 80
selector:
app: nimble-platform
name: frontend-service
nim-prod: frontend-service
56 changes: 28 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,40 @@
"zone.js": "~0.8"
},
"devDependencies": {
"@ngtools/webpack": "~7.3",
"@types/angular": "~1.6",
"@types/angular-animate": "~1.5",
"@types/angular-cookies": "~1.4",
"@types/angular-mocks": "~1.6",
"@types/angular-resource": "~1.5",
"@types/angular-route": "~1.3",
"@types/angular-sanitize": "~1.3",
"@types/core-js": "~2.5",
"@types/file-saver": "~1.3",
"@types/jasmine": "~2.8",
"@types/jasmine": "^3.6.11",
"@types/jquery": "~3.3",
"@types/lunr": "~2.1",
"@types/node": "~10.12",
"@types/underscore": "~1.8",
"angular-router-loader": "~0.8",
"angular2-template-loader": "~0.6",
"awesome-typescript-loader": "~5.2",
"babel-cli": "~6.26",
"babel-core": "~6.26",
"babel-loader": "~7.1",
"babel-preset-angular2": "~0.0",
"babel-preset-env": "~1.7",
"canonical-path": "~0.0",
"clean-webpack-plugin": "~0.1",
"concurrently": "~3.6",
"copy-webpack-plugin": "~5.0",
"cross-env": "~5.2",
"css-loader": "~1.0",
"cssnano": "~4.1",
"del-cli": "~1.1",
"file-loader": "~4.0",
"html-loader": "~0.5",
"html-webpack-plugin": "4.0.0-beta.5",
"http-server-legacy": "~0.11",
"jasmine": "~3.2",
"jasmine-core": "~3.1",
Expand All @@ -89,48 +108,29 @@
"karma-jasmine": "~1.1",
"karma-jasmine-html-reporter": "~1.1",
"karma-phantomjs-launcher": "~1.0",
"lite-server": "~2.4",
"lodash": "~4.17",
"mini-css-extract-plugin": "~0.7",
"node-sass": "~4.12",
"optimize-css-assets-webpack-plugin": "~5.0",
"phantomjs-prebuilt": "~2.1",
"protractor": "~5.3",
"rollup": "~0.57",
"rollup-plugin-commonjs": "~9.1",
"rollup-plugin-node-resolve": "~3.3",
"rollup-plugin-uglify": "~3.0",
"source-map-explorer": "~1.5",
"tslint": "~5.10",
"typings": "~2.1",
"@ngtools/webpack": "~7.3",
"@types/core-js": "~2.5",
"@types/node": "~10.12",
"angular-router-loader": "~0.8",
"angular2-template-loader": "~0.6",
"awesome-typescript-loader": "~5.2",
"babel-core": "~6.26",
"babel-loader": "~7.1",
"babel-preset-env": "~1.7",
"clean-webpack-plugin": "~0.1",
"copy-webpack-plugin": "~5.0",
"cross-env": "~5.2",
"css-loader": "~1.0",
"cssnano": "~4.1",
"del-cli": "~1.1",
"file-loader": "~4.0",
"html-loader": "~0.5",
"html-webpack-plugin": "4.0.0-beta.5",
"lite-server": "~2.4",
"mini-css-extract-plugin": "~0.7",
"node-sass": "~4.12",
"optimize-css-assets-webpack-plugin": "~5.0",
"sass-loader": "~7.1",
"source-map-explorer": "~1.5",
"style-loader": "~0.23",
"to-string-loader": "~1.1",
"tslint": "~5.10",
"typescript": "~3.2",
"typings": "~2.1",
"uglifyjs-webpack-plugin": "~2.0",
"webpack": "~4.29",
"webpack-cli": "~3.2",
"webpack-dev-server": "~3.1",
"webpack-merge": "~4.2",
"@types/jquery": "~3.3"
"webpack-merge": "~4.2"
},
"repository": {}
}
7 changes: 4 additions & 3 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@
</a>
</li>
</ul>
<ul class="nav navbar-nav">
<!-- <ul class="nav navbar-nav">
<li class="nav-item">
<a class="nav-link pointer" (click)="open(support)" [title]="'Help' | translate">
<i class="fa fa-question-circle"></i>
</a>
</li>
</ul>
</ul> -->
<ul class="nav navbar-nav">
<li ngbDropdown class="nav-item dropdown" routerLinkActive="active">
<a class="nav-link pointer" [title]="config.platformName" id="dropdownMenuPlat" ngbDropdownToggle>
Expand Down Expand Up @@ -298,7 +298,8 @@ <h4 class="modal-title" [innerHTML]="'Help' | translate">Help</h4>
</div>

<div *ngIf="!minimalView" id="footer">
<img src="../assets/images/eu_flag.png" alt=""> <span [innerHTML]="fundingDisclaimer"></span>
<!-- <img src="../assets/images/eu_flag.png" alt=""> -->
<span [innerHTML]="fundingDisclaimer"></span>
<div *ngIf="versions.length > 0">
<small>
<span *ngFor="let version of versions; let i = index" [attr.data-index]="i">
Expand Down
Loading