mirror of https://github.com/tidwall/tile38.git
parent
3bfd188c9c
commit
846386c7ff
|
@ -9,5 +9,3 @@ packages/
|
|||
# Ignore IDE folders
|
||||
.idea/
|
||||
.vscode/
|
||||
vendor/*
|
||||
/vendor/
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
variables:
|
||||
GITLAB_IMAGE: registry.gitlab.com/oceanboltpub/tile38
|
||||
|
||||
stages:
|
||||
- build
|
||||
- push
|
||||
|
||||
.build_images: &build_images
|
||||
before_script:
|
||||
- echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token registry.gitlab.com --password-stdin
|
||||
- docker login -u _json_key --password-stdin https://eu.gcr.io < $GITLAB_DEPLOY_BOT_KEY
|
||||
image: docker:19.03.0
|
||||
services:
|
||||
- docker:19.03.0-dind
|
||||
variables:
|
||||
#DOCKER_HOST: tcp://localhost:2375
|
||||
DOCKER_TLS_DIR: "/certs"
|
||||
DOCKER_DRIVER: overlay2
|
||||
stage: build
|
||||
only:
|
||||
- master
|
||||
- development
|
||||
- merge_requests
|
||||
tags:
|
||||
- docker
|
||||
script:
|
||||
- docker pull $GITLAB_IMAGE:$EDITION || true
|
||||
- >
|
||||
docker build
|
||||
--build-arg VCS_REF=$CI_COMMIT_SHA
|
||||
--build-arg VCS_URL=$CI_PROJECT_URL
|
||||
--tag $GITLAB_IMAGE:$CI_COMMIT_SHA
|
||||
.
|
||||
- docker push $GITLAB_IMAGE
|
||||
|
||||
|
||||
.push_master: &push_master
|
||||
before_script:
|
||||
- echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token registry.gitlab.com --password-stdin
|
||||
- docker login -u _json_key --password-stdin https://eu.gcr.io < $GITLAB_DEPLOY_BOT_KEY
|
||||
image: docker:19.03.0
|
||||
services:
|
||||
- docker:19.03.0-dind
|
||||
stage: push
|
||||
only:
|
||||
- master
|
||||
variables:
|
||||
# Again, we do not need the source code here. Just playing with Docker.
|
||||
GIT_STRATEGY: none
|
||||
#DOCKER_HOST: tcp://localhost:2375
|
||||
DOCKER_DRIVER: overlay2
|
||||
# Create the certificates inside this directory for both the server
|
||||
# and client. The certificates used by the client will be created in
|
||||
# /certs/client so we only need to share this directory with the
|
||||
# volume mount in `config.toml`.
|
||||
DOCKER_TLS_CERTDIR: "/certs"
|
||||
script:
|
||||
- docker pull $GITLAB_IMAGE:$CI_COMMIT_SHA
|
||||
- docker tag $GITLAB_IMAGE:$CI_COMMIT_SHA $GITLAB_IMAGE:latest
|
||||
- docker push $GITLAB_IMAGE:latest
|
||||
# Here, the goal is to tag the "master" branch as "latest"
|
18
Dockerfile
18
Dockerfile
|
@ -1,21 +1,9 @@
|
|||
FROM golang:1.13 as builder
|
||||
|
||||
# Copy local code to the container image.
|
||||
WORKDIR /tile38
|
||||
COPY . .
|
||||
COPY ./cmd/tile38-server/main.go .
|
||||
|
||||
# Build the command inside the container.
|
||||
# (You may fetch or manage dependencies here,
|
||||
# either manually or with a tool like "godep".)
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -v -o tile38-server
|
||||
|
||||
FROM alpine:3.8
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
||||
COPY --from=builder /tile38/tile38-server /usr/local/bin/tile38-server
|
||||
#ADD tile38-cli /usr/local/bin
|
||||
#ADD tile38-benchmark /usr/local/bin
|
||||
ADD tile38-server /usr/local/bin
|
||||
ADD tile38-cli /usr/local/bin
|
||||
ADD tile38-benchmark /usr/local/bin
|
||||
|
||||
RUN addgroup -S tile38 && \
|
||||
adduser -S -G tile38 tile38 && \
|
||||
|
|
Loading…
Reference in New Issue