diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 000000000..c4b1a684d
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,25 @@
+**/.classpath
+**/.dockerignore
+**/.env
+**/.git
+**/.gitignore
+**/.project
+**/.settings
+**/.toolstarget
+**/.vs
+**/.vscode
+**/*.*proj.user
+**/*.dbmdl
+**/*.jfm
+**/azds.yaml
+**/bin
+**/charts
+**/docker-compose*
+**/Dockerfile*
+**/node_modules
+**/npm-debug.log
+**/www
+**/secrets.dev.yaml
+**/values.dev.yaml
+LICENSE
+README.md
\ No newline at end of file
diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml
index 1bcdb73bc..072acbca0 100644
--- a/bitbucket-pipelines.yml
+++ b/bitbucket-pipelines.yml
@@ -1,31 +1,31 @@
-image: node:14.15.0
-
+definitions:
+ services:
+ docker:
+ memory: 3072
pipelines:
branches:
- '{master,test}':
- # - step:
- # caches:
- # - node
- # script:
- # - apt-get update; apt-get install -y gettext-base;
- # - echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
- # - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- # - set -x && apt-get update && apt-get install -y xvfb google-chrome-stable
- # - wget -q -O /usr/bin/xvfb-chrome https://bitbucket.org/atlassian/docker-node-chrome-firefox/raw/ff180e2f16ea8639d4ca4a3abb0017ee23c2836c/scripts/xvfb-chrome
- # - ln -sf /usr/bin/xvfb-chrome /usr/bin/google-chrome
- # - chmod 755 /usr/bin/google-chrome
- # - npm ci
- # - npm install
- # - ./node_modules/@angular/cli/bin/ng -v
- # - npm run test
+ developer:
+ - step:
+ size: 2x
+ name: 'Build Images and push to Docker hub'
+ caches:
+ - docker
+ script:
+ - export BITBUCKET_COMMIT_SHORT=$(echo $BITBUCKET_COMMIT| cut -c1-7)
+ - export IMAGE_NAME=gabinetedigital/gdsite:$BITBUCKET_COMMIT_SHORT
+ - docker build -t $IMAGE_NAME .
+ - docker login --username $DOCKER_USER --password $DOCKER_PASS
+ - docker push $IMAGE_NAME
+ - step:
+ name: 'Deploy on server'
+ script:
+ - echo "Starting deploy..."
+ - export BITBUCKET_COMMIT_SHORT=$(echo $BITBUCKET_COMMIT| cut -c1-7)
+ - pipe: atlassian/ssh-run:0.4.0
+ variables:
+ SSH_USER: 'administrator'
+ SERVER: '41.63.166.54'
+ COMMAND: 'export GDSITE_VERSION=${BITBUCKET_COMMIT_SHORT};cd ${COMPOSE_FOLDER} ; docker-compose up -d gdsite'
- - step:
- caches:
- - node
- script:
- - apt-get update;
- - npm ci
- - npm install
- - ./node_modules/@angular/cli/bin/ng -v
- - npm run build --prod
-
\ No newline at end of file
+options:
+ docker: true
diff --git a/dockerfile b/dockerfile
index fbee3b3f6..2fadfdb98 100644
--- a/dockerfile
+++ b/dockerfile
@@ -1,68 +1,13 @@
-# # Stage 1: Compile and Build angular codebase
-
-
-
-# # Use official node image as the base image
-
-FROM node:14.15.0 as build
-
-# # Set up ENV
-
-ENV NODE_ENV=production
-
-# Set the working directory
-
-WORKDIR /usr/local/app
-
-
-
-
-
-
-# # Install all the dependencies
-
+FROM node:14 as build
+WORKDIR /app
+COPY ./package*.json /app/
RUN npm config set unsafe-perm true
-
-RUN npm ci
-
-RUN npm audit fix
-
-RUN npm install -g @ionic/cli
-
-RUN npm install -g @angular/cli
-
-RUN npm install -g cordova
-
-RUN npm install -g cordova-res
-
-# # # Generate the build of the application
-
+RUN npm install -g ionic
+RUN npm config set legacy-peer-deps true
+RUN npm install --save --legacy-peer-deps
+COPY ./ /app/
RUN ionic build --prod
-# # Add the source code to app
-
-COPY ./www /usr/local/app/
-
-
-
-# # Stage 2: Serve app with nginx server
-
-
-
-# # Use official nginx image as the base image
-
-# FROM nginx:latest
-
-
-
-# Copy the build output to replace the default nginx contents.
-
-#COPY ./www/ /usr/share/nginx/html/
-
-
-
-# Expose port 80
-
-# EXPOSE 80
-
-#CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
+FROM nginx:alpine
+RUN rm -rf /usr/share/nginx/html/*
+COPY --from=build /app/www/ /usr/share/nginx/html/
\ No newline at end of file
diff --git a/src/app/Rules/despacho.service.ts b/src/app/Rules/despacho.service.ts
index af37382ce..5627b6021 100644
--- a/src/app/Rules/despacho.service.ts
+++ b/src/app/Rules/despacho.service.ts
@@ -51,20 +51,6 @@ export class DespachoService {
return this.processes.CompleteTask(body)
}
- // reencaminhar(note:string, documents:any, serialnumber) {
-
- // let body = {
- // "serialNumber": serialnumber,
- // "action": "Reencaminhar",
- // "ActionTypeId": 98,
- // "dataFields": {
- // "ReviewUserComment": note,
- // },
- // "AttachmentList" :documents,
- // }
- // return this.processes.CompleteTask(body)
- // }
-
executado(note:string, documents:any , serialnumber) {
let body = {
@@ -139,7 +125,7 @@ export class DespachoService {
"dataFields": {
"ReviewUserComment": note,
},
- "AttachmentList" :documents,
+ "AttachmentList" :documents,
}
}
diff --git a/src/app/Rules/pedido.service.ts b/src/app/Rules/pedido.service.ts
index 848b5d728..c49a32a2b 100644
--- a/src/app/Rules/pedido.service.ts
+++ b/src/app/Rules/pedido.service.ts
@@ -29,13 +29,13 @@ export class PedidoService {
return this.processes.postDeferimento(body)
}
- taskCompleteParecer({serialNumber}) {
+ taskCompleteParecer({serialNumber, note}) {
const body = {
"serialNumber": serialNumber,
"action": "Parecer",
"ActionTypeId": 92, // Pedido de parece
"dataFields": {
- "ReviewUserComment": '',
+ "ReviewUserComment": note,
},
"AttachmentList" :null,
}
diff --git a/src/app/modals/create-process/create-process.page.html b/src/app/modals/create-process/create-process.page.html
index 382227f41..2b306ddbf 100644
--- a/src/app/modals/create-process/create-process.page.html
+++ b/src/app/modals/create-process/create-process.page.html
@@ -8,6 +8,8 @@
{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}
{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}
{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}
{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}
{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}
{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}
{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}