Use drone to build releases
This commit is contained in:
		
							
								
								
									
										42
									
								
								.drone.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								.drone.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,42 @@
 | 
				
			|||||||
 | 
					kind: pipeline
 | 
				
			||||||
 | 
					name: default
 | 
				
			||||||
 | 
					type: docker
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					steps:
 | 
				
			||||||
 | 
					  - name: build
 | 
				
			||||||
 | 
					    image: node:latest
 | 
				
			||||||
 | 
					    volumes:
 | 
				
			||||||
 | 
					      - name: build
 | 
				
			||||||
 | 
					        path: /build
 | 
				
			||||||
 | 
					    commands:
 | 
				
			||||||
 | 
					      - echo "v1.2.0" > /build/version.txt
 | 
				
			||||||
 | 
					      - npm install
 | 
				
			||||||
 | 
					      - npm run build
 | 
				
			||||||
 | 
					      - cp -R dist /build/dist
 | 
				
			||||||
 | 
					  - name: package
 | 
				
			||||||
 | 
					    image: tystuyfzand/fpm
 | 
				
			||||||
 | 
					    volumes:
 | 
				
			||||||
 | 
					      - name: build
 | 
				
			||||||
 | 
					        path: /build
 | 
				
			||||||
 | 
					    commands:
 | 
				
			||||||
 | 
					      - export VERSION=`cat /build/version.txt`
 | 
				
			||||||
 | 
					      - packaging/build-package.sh
 | 
				
			||||||
 | 
					      - cd /build/dist && tar zcvf /build/arm-web.tgz .
 | 
				
			||||||
 | 
					      - rm -rf /build/dist
 | 
				
			||||||
 | 
					  - name: release
 | 
				
			||||||
 | 
					    image: tystuyfzand/drone-gitea-release
 | 
				
			||||||
 | 
					    volumes:
 | 
				
			||||||
 | 
					      - name: build
 | 
				
			||||||
 | 
					        path: /build
 | 
				
			||||||
 | 
					    settings:
 | 
				
			||||||
 | 
					      gitea_server: https://git.meow.tf
 | 
				
			||||||
 | 
					      tag_file: /build/version.txt
 | 
				
			||||||
 | 
					      title_file: /build/version.txt
 | 
				
			||||||
 | 
					      files: [ '/build/*' ]
 | 
				
			||||||
 | 
					    environment:
 | 
				
			||||||
 | 
					      PLUGIN_API_KEY:
 | 
				
			||||||
 | 
					        from_secret: gitea_token
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					volumes:
 | 
				
			||||||
 | 
					  - name: build
 | 
				
			||||||
 | 
					    temp: {}
 | 
				
			||||||
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -11,3 +11,6 @@ yarn-error.log*
 | 
				
			|||||||
*.ntvs*
 | 
					*.ntvs*
 | 
				
			||||||
*.njsproj
 | 
					*.njsproj
 | 
				
			||||||
*.sln
 | 
					*.sln
 | 
				
			||||||
 | 
					*.iml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					package-lock.json
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,4 @@
 | 
				
			|||||||
mkdir -p out || true
 | 
					fpm -s dir -t deb -p /build/arm-web_$VERSION.deb \
 | 
				
			||||||
fpm -s dir -t deb -p out/arm-web_$VERSION.deb \
 | 
					 | 
				
			||||||
    -n arm-web -v $VERSION \
 | 
					    -n arm-web -v $VERSION \
 | 
				
			||||||
    --deb-priority optional --force \
 | 
					    --deb-priority optional --force \
 | 
				
			||||||
    --deb-compression bzip2 \
 | 
					    --deb-compression bzip2 \
 | 
				
			||||||
@ -8,4 +7,4 @@ fpm -s dir -t deb -p out/arm-web_$VERSION.deb \
 | 
				
			|||||||
    --depends nginx \
 | 
					    --depends nginx \
 | 
				
			||||||
    --url "https://meow.tf" \
 | 
					    --url "https://meow.tf" \
 | 
				
			||||||
    packaging/arm.conf=/etc/nginx/conf.d/arm.conf \
 | 
					    packaging/arm.conf=/etc/nginx/conf.d/arm.conf \
 | 
				
			||||||
    dist/=/var/www/arm-web
 | 
					    /build/dist=/var/lib/arm/web
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <ul class="navbar-nav ml-auto" v-if="sensors.cpu || sensors.memory || sensors.disks">
 | 
					  <ul class="navbar-nav ml-auto" v-if="sensors.cpu || sensors.cpuName || sensors.memory || sensors.disks">
 | 
				
			||||||
    <cpu_status :status="sensors.cpu" :cpuName="sensors.cpuName" :temperatures="sensors.temperatures"></cpu_status>
 | 
					    <cpu_status :status="sensors.cpu" :cpuName="sensors.cpuName" :temperatures="sensors.temperatures"></cpu_status>
 | 
				
			||||||
    <memory_status :status="sensors.memory"></memory_status>
 | 
					    <memory_status :status="sensors.memory"></memory_status>
 | 
				
			||||||
    <disk_status :status="sensors.disks"></disk_status>
 | 
					    <disk_status :status="sensors.disks"></disk_status>
 | 
				
			||||||
 | 
				
			|||||||
@ -27,15 +27,12 @@
 | 
				
			|||||||
        if (!this.status) {
 | 
					        if (!this.status) {
 | 
				
			||||||
          return '0.00';
 | 
					          return '0.00';
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return parseFloat(this.status.UserPct).toFixed(2);
 | 
					        return parseFloat(this.status).toFixed(2);
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      percentageClass: function() {
 | 
					      percentageClass: function() {
 | 
				
			||||||
        if (!this.status) {
 | 
					        if (this.status >= 90) {
 | 
				
			||||||
          return 'info';
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (this.status.UserPct >= 90) {
 | 
					 | 
				
			||||||
          return 'danger';
 | 
					          return 'danger';
 | 
				
			||||||
        } else if (this.status.UserPct >= 80) {
 | 
					        } else if (this.status >= 80) {
 | 
				
			||||||
          return 'warning';
 | 
					          return 'warning';
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return 'success'
 | 
					        return 'success'
 | 
				
			||||||
 | 
				
			|||||||
@ -2,11 +2,11 @@
 | 
				
			|||||||
  <b-nav-item-dropdown no-caret right>
 | 
					  <b-nav-item-dropdown no-caret right>
 | 
				
			||||||
    <template slot="button-content">
 | 
					    <template slot="button-content">
 | 
				
			||||||
      <font-awesome-icon icon="microchip" /> Memory
 | 
					      <font-awesome-icon icon="microchip" /> Memory
 | 
				
			||||||
      <b-progress :value="memoryPercentage" height=".5rem" :variant="percentageClass"></b-progress>
 | 
					      <b-progress :value="this.status.usedPercent" height=".5rem" :variant="percentageClass"></b-progress>
 | 
				
			||||||
    </template>
 | 
					    </template>
 | 
				
			||||||
    <b-dropdown-header class="text-center">Memory</b-dropdown-header>
 | 
					    <b-dropdown-header class="text-center">Memory</b-dropdown-header>
 | 
				
			||||||
    <div class="text-center">
 | 
					    <div class="text-center">
 | 
				
			||||||
      <span :class="'badge badge-' + percentageClass"><formatBytes :bytes="status.MemUsed * 1024" /> / <formatBytes :bytes="status.MemTotal * 1024" /></span>
 | 
					      <span :class="'badge badge-' + percentageClass"><formatBytes :bytes="status.used * 1024" /> / <formatBytes :bytes="status.total * 1024" /></span>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
  </b-nav-item-dropdown>
 | 
					  </b-nav-item-dropdown>
 | 
				
			||||||
@ -17,14 +17,8 @@
 | 
				
			|||||||
    name: 'memory_status',
 | 
					    name: 'memory_status',
 | 
				
			||||||
    props: [ 'status' ],
 | 
					    props: [ 'status' ],
 | 
				
			||||||
    computed: {
 | 
					    computed: {
 | 
				
			||||||
      memoryPercentage: function() {
 | 
					 | 
				
			||||||
        return (this.status.MemUsed / this.status.MemTotal) * 100;
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      memoryBufCachePercentage: function() {
 | 
					 | 
				
			||||||
        return ((this.status.Buffers + this.status.Cached) / this.status.MemTotal) * 100;
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      percentageClass: function() {
 | 
					      percentageClass: function() {
 | 
				
			||||||
        let usedPercent = (this.status.MemUsed / this.status.MemTotal) * 100;
 | 
					        let usedPercent = this.status.usedPercent;
 | 
				
			||||||
        if (usedPercent >= 90) {
 | 
					        if (usedPercent >= 90) {
 | 
				
			||||||
          return 'danger';
 | 
					          return 'danger';
 | 
				
			||||||
        } else if (usedPercent >= 80) {
 | 
					        } else if (usedPercent >= 80) {
 | 
				
			||||||
 | 
				
			|||||||
@ -1,3 +1,3 @@
 | 
				
			|||||||
window.arm_config = {
 | 
					window.arm_config = {
 | 
				
			||||||
  url: 'ws://192.168.2.85:8080/ws'
 | 
					  url: 'ws://192.168.1.8:8080/ws'
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user