Merge branch 'develop'

This commit is contained in:
ErickSkrauch 2017-09-11 14:25:15 +03:00
commit e33b86b809
3 changed files with 31 additions and 4 deletions

View File

@ -26,7 +26,7 @@ variables:
.docker_template: &setup_docker_environment
image: docker:latest
before_script:
- docker login -u gitlab-ci -p $CI_BUILD_TOKEN registry.ely.by
- docker login -u gitlab-ci -p $CI_JOB_TOKEN registry.ely.by
- export TEMP_IMAGE_NAME="$CONTAINER_IMAGE:$CI_PIPELINE_ID"
test:
@ -39,12 +39,12 @@ build executable:
<<: *setup_go_environment
stage: build
script:
- export VERSION="${CI_BUILD_TAG:-dev-$CI_BUILD_REF_NAME-${CI_BUILD_REF:0:8}+build-$CI_BUILD_ID}"
- export VERSION="${CI_COMMIT_TAG:-dev-$CI_COMMIT_REF_NAME-${CI_COMMIT_SHA:0:8}+build-$CI_JOB_ID}"
- >
env GOOS=linux
go build
-o $CI_PROJECT_DIR/minecraft-skinsystem
-ldflags "-X ${CI_PROJECT_NAMESPACE}/bootstrap.version=${VERSION}"
-ldflags "-X ${CI_PROJECT_PATH}/bootstrap.version=${VERSION}"
main.go
artifacts:
name: "${CI_JOB_STAGE} executable"
@ -79,7 +79,7 @@ push tag:
variables:
GIT_STRATEGY: none
script:
- export IMAGE_NAME="$CONTAINER_IMAGE:$CI_BUILD_TAG"
- export IMAGE_NAME="$CONTAINER_IMAGE:$CI_COMMIT_TAG"
- export LATEST_IMAGE_NAME="$CONTAINER_IMAGE:latest"
- docker tag $TEMP_IMAGE_NAME $IMAGE_NAME
- docker tag $TEMP_IMAGE_NAME $LATEST_IMAGE_NAME

23
cmd/version.go Normal file
View File

@ -0,0 +1,23 @@
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"elyby/minecraft-skinsystem/bootstrap"
"runtime"
)
var versionCmd = &cobra.Command{
Use: "version",
Short: "Show the Minecraft Skinsystem version information",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("Version: %s\n", bootstrap.GetVersion())
fmt.Printf("Go version: %s\n", runtime.Version())
fmt.Printf("OS/Arch: %s/%s\n", runtime.GOOS, runtime.GOARCH)
},
}
func init() {
RootCmd.AddCommand(versionCmd)
}

View File

@ -1,5 +1,9 @@
FROM alpine:3.6
RUN apk --update add ca-certificates \
&& update-ca-certificates \
&& rm -rf /var/cache/apk/*
COPY docker/docker-entrypoint.sh /usr/local/bin/
COPY docker/config.dist.yml /usr/local/etc/minecraft-skinsystem/