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

Elhadj pre reg #160

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
14f4d23
MOSIP-18322 fixed RTL issues
mayuradesh Mar 17, 2022
df85a95
Merge pull request #89 from mayuradesh/bug_fixes
mayuradesh Mar 17, 2022
536f74a
updated push_trigger
mayuradesh Mar 17, 2022
e073c42
Merge pull request #90 from mayuradesh/bug_fixes
mayuradesh Mar 17, 2022
8263c6f
[MOSIP-20020] Update release_changes.yml
ckm007 May 12, 2022
466ebf1
Merge pull request #98 from mosip/ckm007-patch-1
ckm007 May 12, 2022
0fe607a
[ MOSIP-20021 ] updated release_changes.yml to update README.md badges
syedsalman3753 May 19, 2022
7c1b937
Merge pull request #99 from syed-salman-technoforte/patch-1
ckm007 May 20, 2022
97cb93f
[MOSIP-20028] added action for tagging
ckm007 Jul 18, 2022
59d7c71
Update README.md
mayuradesh Sep 7, 2022
55220c7
Merge pull request #118 from mosip/mayuradesh-patch-1
gsasikumar Sep 7, 2022
4b650bb
Update README.md
mayuradesh Sep 27, 2022
69b01d8
Merge pull request #131 from mosip/mayuradesh-patch-7
gsasikumar Sep 27, 2022
0b77b0c
Update release_changes.yml
ckm007 Sep 29, 2022
bd41cbd
Merge pull request #133 from mosip/ckm007-patch-1
ckm007 Sep 29, 2022
90edf04
Release Bot Pre-release changes
ckm007 Sep 29, 2022
06d1a4b
Update README.md
ckm007 Sep 29, 2022
d35c598
Merge pull request #134 from mosip/release-branch
ckm007 Sep 29, 2022
8434950
Added Guinea Customisation
Chithara27 Jun 6, 2023
d83db17
Updated Guinea Customization
Chithara27 Jun 7, 2023
2854d51
adding menu items
elhadj21 Jun 22, 2023
9becba2
Updated Guidelines Template name for Guinea pilot.
Chithara27 Jun 28, 2023
f5faf2f
Removed extra unwanted text
Chithara27 Jun 28, 2023
506c088
Merge pull request #1 from WuriGuinea/Elhadj_preReg
wuritechteam Jul 5, 2023
7954bdc
gestion labels et page time-selection
elhadj21 Jul 6, 2023
bd15fbb
Merge pull request #2 from WuriGuinea/Elhadj_preReg
wuritechteam Jul 6, 2023
ccf8c69
PreReg customisation
elhadj21 Jul 17, 2023
71157a8
Merge branch 'WuriGuinea-1.2.0.1-B1' of https://github.com/WuriGuinea…
elhadj21 Jul 17, 2023
9e417c5
adding the new proxy conf file
Oct 11, 2023
a8305a5
config_old file deleted
Oct 11, 2023
c05a6dd
fichier de langue
Oct 12, 2023
9f5be51
src/assets/i18n/fra.json
Dec 11, 2023
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
54 changes: 54 additions & 0 deletions .github/workflows/prereg-ui-build-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Pre-registration UI build

on: workflow_dispatch

jobs:
build-pre-registration-ui:

runs-on: ubuntu-latest
env:
NAMESPACE: ${{ secrets.dev_namespace_docker_hub }}
SERVICE_NAME: pre-registration-ui
SERVICE_LOCATION: pre-registration-ui

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-node@v1

- name: npm install
run: cd ${{ env.SERVICE_LOCATION }} && npm install --ignore-scripts

- name: npm build
run: cd ${{ env.SERVICE_LOCATION }} && npm run-script build -- --prod --base-href . --output-path=dist
- name: Setup branch and env
run: |
# Strip git ref prefix from version
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
- name: setup environment
run: |
# Strip git ref prefix from version
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV

- name: Build image
run: |
cd "./${{env.SERVICE_LOCATION}}"
docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }}

- name: Log into registry
run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin

- name: Push image
run: |
IMAGE_ID=$NAMESPACE/$SERVICE_NAME

# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$BRANCH_NAME
echo "push version $VERSION"
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $SERVICE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
17 changes: 2 additions & 15 deletions .github/workflows/push_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,6 @@ jobs:
run: |
# Strip git ref prefix from version
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV

- name: run sonar analysis
run: |
cd "./${{env.SERVICE_LOCATION}}"
echo "sonar.host.url=https://sonarcloud.io/
sonar.login=${{ secrets.SONAR_TOKEN }}
sonar.projectKey=mosip_pre-registration-ui
sonar.organization=${{ secrets.ORG_KEY }}
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.exclusions=**/node_modules/**
sonar.tests=src
sonar.test.inclusions=**/*.spec.ts
sonar.typescript.lcov.reportPaths=coverage/lcov.info" >> sonar-project.properties
npm install sonar-scanner && npm run sonar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down Expand Up @@ -110,6 +95,8 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14'

- name: npm install
run: cd ${{ env.SERVICE_LOCATION }} && npm install --ignore-scripts
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/release_changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ jobs:
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV

- name: Mannualy changing the pom versions
run: find . -type f -name "*pom.xml" -print0 | xargs -0 sed -i "s/${{ github.event.inputs.snapshotTags }}/${{ github.event.inputs.releaseTags }}/g"
- name: update Branch name in badges
run: |
sed -i 's/branch=.*)]/branch=${{ env.BRANCH_NAME }}\)]/g' README.md
sed -i 's/branch=.*\&/branch=${{ env.BRANCH_NAME }}\&/g' README.md

# - name: Mannualy changing the pom versions
# run: find . -type f -name "*pom.xml" -print0 | xargs -0 sed -i "s/${{ github.event.inputs.snapshotTags }}/${{ github.event.inputs.releaseTags }}/g"

- name: Updating the Release URL in POM
run: |
Expand All @@ -48,7 +53,7 @@ jobs:
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.ACTION_PAT }}
commit-message: Updated Pom versions for release changes
commit-message: Release Bot Pre-release changes
title: Release changes
body: Automated PR for ${{ github.event.inputs.releaseTags }} release.
branch: release-branch
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Tagging of repos

env:
tag: v1.2.3

on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to be published'
required: true
default: 'v1.2.3'
type: string
body:
description: 'Release body message'
required: true
default: 'Changes in this Release'
type: string
pre-release:
description: 'Pre-release? True/False'
required: true
default: False
type: string

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.event.inputs.tag }}
release_name: ${{ github.event.inputs.tag }}
body: |
${{ github.event.inputs.body }}
draft: false
prerelease: ${{fromJSON(github.event.inputs.pre-release)}}
76 changes: 52 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Maven Package upon a push](https://github.com/mosip/pre-registration-ui/actions/workflows/push_trigger.yml/badge.svg?branch=develop)](https://github.com/mosip/pre-registration-ui/actions/workflows/push_trigger.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?branch=develop&project=mosip_pre-registration-ui&metric=alert_status)](https://sonarcloud.io/dashboard?branch=develop&id=mosip_pre-registration-ui)
[![Maven Package upon a push](https://github.com/mosip/pre-registration-ui/actions/workflows/push_trigger.yml/badge.svg?branch=release-1.2.0.1)](https://github.com/mosip/pre-registration-ui/actions/workflows/push_trigger.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?branch=release-1.2.0.1&project=mosip_pre-registration-ui&metric=alert_status)](https://sonarcloud.io/dashboard?branch=release-1.2.0.1&id=mosip_pre-registration-ui)

# Pre-Registration Portal

Expand All @@ -8,31 +8,59 @@ This repository contains UI code for Pre-Registration portal. Refer [here](https
## Build & Deployment Guide

The code is written in Angular JS.

To start off we will be needing a Virtual Machine (VM) of at least 1 core processor and 4 GB memory with Red Hat OS installed. Please follow the following steps after the pre-requisites are met.

- Install GIT – GIT is a version control software, we will be using it to download the source code on our system. Follow the following steps to install GIT on your system.
- yum update (to update all the RHEL packages)
- yum install git (to install git)
- git --version (to verify if git is installed or not)
- Install Docker – Dockeris thesoftware used to create a runnable image from the existing source code. Follow the following steps to install Docker on your system.
- yum install docker (to install docker)
- docker --version (to verify if docker is installed on your system)
- Install node.js – To build the angular code using angular cli that runs on node. Follow the following steps to install node.js on your system.
- yum install rh-nodejs8 (to install node )
- scl enable rh-nodejs8 bash (to add node.js to environment)
- node --version (to verify node.js is working)

- Install node.js – To build the angular code using angular cli that runs on node.
We recommend Node: 14.17.3, Package Manager: npm 6.14.13

- Install angular cli – To install angular cli for building the code into deployable artifacts. Follow the following steps to install angular cli on your system.
- npm install -g @angular/cli (to install angular cli)
- ng --version (to verify angular is installed in system)
- <code>npm install -g @angular/cli</code> (to install angular cli)
- <code>ng --version</code> (to verify angular is installed in system)
We recommend Angular CLI: 13.3.2

- Check out the source code from GIT – To download the source code from git. Follow the following steps to download source code on your system.
- git clone https://github.com/mosip/mosip.git (to clone the source code repository from git)
- <code>git clone https://github.com/mosip/pre-registration-ui.git</code> (to clone the source code repository from git)

### For Production build:

- Build the code – Follow the following steps to build the source code on your system.
- Navigate to the pre-registration-ui directory inside the cloned repository. Then run the following command in that directory
- ng build --prod --base-href . (to build the code)
- <code>ng build "--prod" "--base-href" "." "--output-path=dist" </code>(to build the code)

- Build Docker Image – Follow the following steps to build docker image on your system.
- docker build -t \&lt;name\&gt; . (to build the docker image, replace \&lt;name\&gt; with the name of the image you want, &quot;.&quot; Signifies the current directory from where the docker file has to be read.
- <code>docker build -t name . </code>(to build the docker image, replace <code>name</code> with the name of the image you want, &quot;.&quot; Signifies the current directory from where the docker file has to be read.
- Example: <code>docker build -t preregui .</code>
- Run the docker image – Follow the following steps to build docker image on your system.
- docker run –d –p 80:80 --name \&lt;container name\&gt; \&lt;image name\&gt; (to run the docker image created with the previous step,-d signifies to run the container in detached mode, -p signifies the port mapping left side of the&quot;:&quot; is the external port that will be exposed to the outside world and right side is the internal port of the container that is mapped with the external port. Replace \&lt;container name\&gt; with the name of your choice for the container, replace \&lt;image name\&gt; with the name of the image specified in .the previous step)

Now you can access the user interface over the internet by accessing the public IP of VM via browser.
- <code>docker run –d –p 80:80 --name container-name image-name</code> (to run the docker image created with the previous step,-d signifies to run the container in detached mode, -p signifies the port mapping left side of the&quot;:&quot; is the external port that will be exposed to the outside world and right side is the internal port of the container that is mapped with the external port. Replace <code>container-name</code> with the name of your choice for the container, replace <code>image-name</code> with the name of the image specified in .the previous step)
- Example: <code>docker run -d -p 8080:8080 --name nginx preregui</code>
- Now you can access the user interface over the internet via browser.
- Example: <code>http://localhost:8080/pre-registration-ui/#/eng</code>

### For Local build:
- Build & deploy the code locally – Follow the following steps to build the source code on your system.
- Navigate to the pre-registration-ui directory inside the cloned repository. Then run the following command in that directory
- <code>ng serve</code>
- Now you can access the user interface via browser.
- Example: <code>http://localhost:4200</code>
- But this will give you CORS issue in accessing backend prereg services. To get around the CORS issue, angular CLI proxy can be used.
- Update the API services BASE_URL in config.json
```
{
"BASE_URL": "https://localhost:4200/proxyapi/",
"PRE_REG_URL": "preregistration/v1/"
}
```
- Create a new file named proxy.conf.json. Replace ${servicesUrl} with correct url.
```
{
"/proxyapi": {
"target": ${servicesUrl},
"secure": true,
"changeOrigin": true,
"pathRewrite": {
"^/proxyapi": ""
}
}
}
```
- Now start the server by typing <code>ng serve --proxy-config proxy.conf.json --ssl true</code>
- Open the browser, load the app with <code>https://localhost:4200</code>
2 changes: 1 addition & 1 deletion pre-registration-ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ dist/*
coverage/*
.editorconfig
e2e/*
proxy.conf.json
proxy.confold.json
Loading