diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..7012ba9 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,31 @@ +name: Build +run-name: Build + +on: + push: + +jobs: + publish: + name: Build & Push Dockerfile + uses: ztimson/actions/.github/workflows/docker.yaml@develop + with: + name: ztimson/node-exporter + repository: ${{github.server_url}}/${{github.repository}}.git + pass: ${{secrets.DEPLOY_TOKEN}} + + tag: + name: Tag Version + needs: publish + runs-on: ubuntu-latest + container: node + steps: + - name: Clone Repository + uses: ztimson/actions/clone@develop + + - name: Get Version Number + run: echo "VERSION=$(cat package.json | grep version | grep -Eo ':.+' | grep -Eo '[[:alnum:]\.\/\-]+')" >> $GITHUB_ENV + + - name: Tag Version + uses: ztimson/actions/tag@develop + with: + tag: ${{env.VERSION}} diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml deleted file mode 100644 index aa32afd..0000000 --- a/.gitlab/.gitlab-ci.yml +++ /dev/null @@ -1,16 +0,0 @@ -image: docker:latest - -stages: - - publish - -docker: - stage: publish - before_script: - - docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY - script: - - docker build --no-cache -t "$CI_REGISTRY_IMAGE:latest" -t ztimson/node-exporter:latest . - - docker push "$CI_REGISTRY_IMAGE:latest" - - docker login -u ztimson -p $DOCKER_TOKEN - - docker push "ztimson/node-exporter:latest" - rules: - - if: $CI_COMMIT_BRANCH diff --git a/README.md b/README.md index 360f407..33f092f 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,48 @@ -# Node-Exporter + +
+
-This is a copy of [prom/node-exporter](https://hub.docker.com/r/prom/node-exporter) which also add's the hostname metric. + + Logo -## Example + + ### node-exporter -For the hostname to be detected, you must mount the host's `rootfs` into the container's `/host` directory as seen here: + + node-exporter with hostname -``` + + [![Version](https://img.shields.io/badge/dynamic/json.svg?label=Version&style=for-the-badge&url=https://git.zakscode.com/api/v1/repos/ztimson/node-exporter/tags&query=$[0].name)](https://git.zakscode.com/ztimson/node-exporter/tags) + [![Pull Requests](https://img.shields.io/badge/dynamic/json.svg?label=Pull%20Requests&style=for-the-badge&url=https://git.zakscode.com/api/v1/repos/ztimson/node-exporter&query=open_pr_counter)](https://git.zakscode.com/ztimson/node-exporter/pulls) + [![Issues](https://img.shields.io/badge/dynamic/json.svg?label=Issues&style=for-the-badge&url=https://git.zakscode.com/api/v1/repos/ztimson/node-exporter&query=open_issues_count)](https://git.zakscode.com/ztimson/node-exporter/issues) + + + + --- +
+ Release Notes + • Report a Bug + • Request a Feature +
+ + --- +
+ +## Table of Contents +- [node-exporter](#top) + - [About](#about) + - [Built With](#built-with) + - [Setup](#setup) + - [Production](#production) + - [Development](#development) + +## About + +This is an extension of [prom/node-exporter](https://hub.docker.com/r/prom/node-exporter) which adds the hostname as a metric. + +For the hostname to be detected, you must mount the host's `rootfs` into the container's `/host` directory: + +```yaml version: '3.8' services: @@ -21,3 +57,40 @@ services: deploy: mode: global ``` + +[See on DockerHub](https://hub.docker.com/r/ztimson/node-exporter) + +### Built With +[![Docker](https://img.shields.io/badge/Docker-384d54?style=for-the-badge&logo=docker)](https://docker.com/) + +## Setup + +
+ +

+ Production +

+
+ +#### Prerequisites +- [Docker](https://docs.docker.com/install/) + +#### Instructions +1. Run the docker image: `docker run -v "/:/host:ro,rslave" ztimson/node-exporter --path.rootfs=/host` +
+ +
+ +

+ Development +

+
+ +#### Prerequisites +- [Docker](https://docs.docker.com/install/) + +#### Instructions +1. Build the docker image: `docker build -t MY_IMAGE:TAG .` +2. Run docker image: `docker run -v "/:/host:ro,rslave" MY_IMAGE:TAG --path.rootfs=/host` + +