Commit 23808871 authored by Luke Brown's avatar Luke Brown 🤖
Browse files

add new version job

parent afaee5f8
Pipeline #762 canceled with stages
in 1 minute and 33 seconds
stages:
- setup
- version
- build
- test
- deploy
variables:
npm_config_cache: "$CI_PROJECT_DIR/.npm"
SCRIPTS_REPO: https://git.covalent.space/covalent-space/devember2021/ci-scripts.git
before_script:
- export SCRIPTS_DIR=$(mktemp -d)
- git clone -q --depth 1 "$SCRIPTS_REPO" "$SCRIPTS_DIR"
# This folder is cached between builds
cache:
......@@ -38,34 +44,60 @@ prepare_dependencies:
expire_in: 1h
paths:
- node_modules
only:
- branches
tags:
- node
- lts
test_lint:
stage: test
version:
image: python:3
stage: version
script:
- npm run lint
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- ssh-keyscan git.covalent.space >> ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- pip install semver
- $SCRIPTS_DIR/common/gen-semver > version
artifacts:
paths:
- version
only:
- master
build_dist:
stage: build
script:
- export VERSION="unknown"
- "[ -f ./version ] && export VERSION=$(cat ./version)"
- 'VUE_APP_VERSION=$VERSION npm run build'
artifacts:
paths:
- dist/
expire_in: 1 week
only:
- branches
tags:
- node
- lts
test_unit:
test_lint:
stage: test
script:
- npm run test:unit
- npm run lint
only:
- branches
tags:
- node
- lts
build_dist:
stage: build
test_unit:
stage: test
script:
- npm run build
artifacts:
paths:
- dist/
expire_in: 1 week
- npm run test:unit
only:
- branches
tags:
- node
- lts
......@@ -74,8 +106,8 @@ build_dist:
stage: deploy
script:
- cp -a dist/ $DEPLOY_DIR
tags:
- shell
only:
- branches
deploy_prod_www1:
<<: *deploy
......
......@@ -49,10 +49,7 @@
>
<router-link
:to="link.href"
class="
text-decoration-none text-uppercase text-caption
font-weight-regular
"
class="text-decoration-none text-uppercase text-caption font-weight-regular"
rel="noopener"
target="_self"
v-text="link.text"
......
<template>
<div class="about">
<h1>This is an about page</h1>
<div>
<v-card>
<v-card-title>App Info</v-card-title>
<v-list>
<v-list-item>
<v-list-item-action><v-icon>mdi-tag</v-icon></v-list-item-action>
<v-list-item-title>
WebUI
<span class="font-weight-bold">v{{ appVersion }}</span>
</v-list-item-title>
</v-list-item>
</v-list>
</v-card>
</div>
</template>
<script>
export default {
computed: {
// return an app version string
appVersion() {
let ver = "";
if (process.env.VUE_APP_VERSION) {
ver = process.env.VUE_APP_VERSION;
} else {
ver = "0.0.0";
}
return ver;
},
},
};
</script>
process.env.VUE_APP_VERSION = require("./package.json").version;
// process.env.VUE_APP_VERSION = require("./package.json").version;
module.exports = {
transpileDependencies: ["vuetify"],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment