feat(CI): Adding CI pipeline
This commit is contained in:
24
.gitlab-ci.yml
Normal file
24
.gitlab-ci.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
stages:
|
||||||
|
- build
|
||||||
|
|
||||||
|
variables:
|
||||||
|
PIPELINE_WORK_DIR: "./"
|
||||||
|
DOCKERFILE_PATH: "./"
|
||||||
|
BUILD_NAME: "enruta_web_dashboard"
|
||||||
|
CONTAINER_NAME: "enruta-web_dashboard"
|
||||||
|
VITE_API_URL: "https://api.etaviaporte.com/api"
|
||||||
|
PUBLIC_PORT: 8000
|
||||||
|
PRIVATE_PORT: 8000
|
||||||
|
|
||||||
|
build-job:
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- . ./scripts/ci_functions.sh
|
||||||
|
- build_static
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- $PIPELINE_WORK_DIR/$BUILD_NAME.zip
|
||||||
|
expire_in: 1 week
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
6
htaccess
Normal file
6
htaccess
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
Options -MultiViews
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteRule ^ index.html [QSA,L]
|
||||||
|
RewriteCond %{HTTPS} off
|
||||||
|
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
|
||||||
15
scripts/ci_functions.sh
Normal file
15
scripts/ci_functions.sh
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
# Requirements
|
||||||
|
# Node v18
|
||||||
|
function build_static(){
|
||||||
|
#Global ENV VAR: BUILD_NAME
|
||||||
|
#Global ENV VAR: VITE_API_URL
|
||||||
|
nvm use 18
|
||||||
|
npm install --force 2>/dev/null
|
||||||
|
set -x
|
||||||
|
npm run build 2>/dev/null
|
||||||
|
cp htaccess dist/.htaccess
|
||||||
|
zip -r $BUILD_NAME.zip dist/
|
||||||
|
set +x
|
||||||
|
}
|
||||||
@@ -9,8 +9,8 @@
|
|||||||
import { useAuthStore } from '../stores/auth';
|
import { useAuthStore } from '../stores/auth';
|
||||||
|
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
email: 'alexandrous.dev@gmail.com',
|
email: '',
|
||||||
password: 'Password0',
|
password: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|||||||
Reference in New Issue
Block a user