Skip to content

Commit

Permalink
package: docker image now includes actual version
Browse files Browse the repository at this point in the history
Also fix several typos
  • Loading branch information
yasker committed Apr 13, 2017
1 parent 431ceda commit 5528110
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Makefile
@@ -1,5 +1,5 @@
NS = rancher
VERSION ?= latest
VERSION = $(shell ./scripts/version)

REPO = longhorn-ui
NAME = longhorn-ui
Expand All @@ -11,6 +11,7 @@ PORT = 8000

build:
docker build -t $(NS)/$(REPO):$(VERSION) .
@echo Build $(NS)/$(REPO):$(VERSION) successful

stop:
docker stop $(NAME)-$(INSTANCE)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -11,8 +11,8 @@ Prerequisites:

Setup:
```bash
git clone 'https://github.com/rancher/longhron-ui'
cd 'longhron-ui'
git clone 'https://github.com/rancher/longhorn-ui'
cd 'longhorn-ui'
npm install
```
Run development server pointed at some Longhron Manger API
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,5 +1,5 @@
{
"name": "longhron",
"name": "longhorn",
"version": "0.0.1",
"private": true,
"scripts": {
Expand Down
17 changes: 17 additions & 0 deletions scripts/version
@@ -0,0 +1,17 @@
#!/bin/bash
set -e

if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
DIRTY="-dirty"
fi

COMMIT=$(git rev-parse --short HEAD)
GIT_TAG=$(git tag -l --contains HEAD | head -n 1)

if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then
VER=$GIT_TAG
else
VER="${COMMIT}${DIRTY}"
fi

echo ${VER}

0 comments on commit 5528110

Please sign in to comment.