mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 20:35:24 +01:00
commit
8c25ca1a7f
@ -1,7 +1,6 @@
|
|||||||
dry-run: null
|
dry-run: null
|
||||||
hookfiles: ./.dredd/compiled_hooks
|
hookfiles: ./.dredd/compiled_hooks
|
||||||
language: go
|
language: go
|
||||||
sandbox: false
|
|
||||||
#server: context=dev task dc:up
|
#server: context=dev task dc:up
|
||||||
server-wait: 240
|
server-wait: 240
|
||||||
init: false
|
init: false
|
||||||
@ -17,9 +16,7 @@ inline-errors: false
|
|||||||
details: false
|
details: false
|
||||||
method: []
|
method: []
|
||||||
color: true
|
color: true
|
||||||
level: info
|
loglevel: debug
|
||||||
timestamp: false
|
|
||||||
silent: false
|
|
||||||
path: []
|
path: []
|
||||||
hooks-worker-timeout: 5000
|
hooks-worker-timeout: 5000
|
||||||
hooks-worker-connect-timeout: 1500
|
hooks-worker-connect-timeout: 1500
|
||||||
@ -31,4 +28,4 @@ hooks-worker-handler-host: 0.0.0.0
|
|||||||
hooks-worker-handler-port: 61321
|
hooks-worker-handler-port: 61321
|
||||||
config: ./.dredd/dredd.yml
|
config: ./.dredd/dredd.yml
|
||||||
blueprint: api-docs.yml
|
blueprint: api-docs.yml
|
||||||
endpoint: 'http://0.0.0.0:3000'
|
endpoint: 'http://semaphore_ci:3000'
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
dry-run: null
|
dry-run: null
|
||||||
hookfiles: ./.dredd/compiled_hooks
|
hookfiles: ./.dredd/compiled_hooks
|
||||||
language: go
|
language: go
|
||||||
sandbox: false
|
|
||||||
#server: context=dev task dc:up
|
#server: context=dev task dc:up
|
||||||
server-wait: 240
|
server-wait: 240
|
||||||
init: false
|
init: false
|
||||||
@ -17,9 +16,7 @@ inline-errors: false
|
|||||||
details: false
|
details: false
|
||||||
method: []
|
method: []
|
||||||
color: true
|
color: true
|
||||||
level: info
|
loglevel: debug
|
||||||
timestamp: false
|
|
||||||
silent: false
|
|
||||||
path: []
|
path: []
|
||||||
hooks-worker-timeout: 5000
|
hooks-worker-timeout: 5000
|
||||||
hooks-worker-connect-timeout: 1500
|
hooks-worker-connect-timeout: 1500
|
||||||
|
@ -58,10 +58,10 @@ tasks:
|
|||||||
- go install github.com/haya14busa/goverage
|
- go install github.com/haya14busa/goverage
|
||||||
- go install github.com/snikch/goodman/cmd/goodman
|
- go install github.com/snikch/goodman/cmd/goodman
|
||||||
- go install github.com/go-swagger/go-swagger/cmd/swagger
|
- go install github.com/go-swagger/go-swagger/cmd/swagger
|
||||||
- '{{ if ne OS "windows" }} bash -c "curl -L https://github.com/goreleaser/goreleaser/releases/download/v{{ .GORELEASER_VERSION }}/goreleaser_$(uname -s)_$(uname -m).tar.gz | tar -xz -C $(go env GOPATH)/bin goreleaser"{{ else }} {{ end }}'
|
- '{{ if ne OS "windows" }} sh -c "curl -L https://github.com/goreleaser/goreleaser/releases/download/v{{ .GORELEASER_VERSION }}/goreleaser_$(uname -s)_$(uname -m).tar.gz | tar -xz -C $(go env GOPATH)/bin goreleaser"{{ else }} {{ end }}'
|
||||||
- '{{ if ne OS "windows" }} chmod +x $(go env GOPATH)/bin/goreleaser{{ else }} {{ end }}'
|
- '{{ if ne OS "windows" }} chmod +x $(go env GOPATH)/bin/goreleaser{{ else }} {{ end }}'
|
||||||
- '{{ if eq OS "windows" }} echo "NOTICE: You must download goreleaser manually to build this application https://github.com/goreleaser/goreleaser/releases "{{ else }}:{{ end }}'
|
- '{{ if eq OS "windows" }} echo "NOTICE: You must download goreleaser manually to build this application https://github.com/goreleaser/goreleaser/releases "{{ else }}:{{ end }}'
|
||||||
- '{{ if ne OS "windows" }} bash -c "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v{{ .GOLINTER_VERSION }}"{{ else }}{{ end }}'
|
- '{{ if ne OS "windows" }} sh -c "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v{{ .GOLINTER_VERSION }}"{{ else }}{{ end }}'
|
||||||
- '{{ if eq OS "windows" }} echo "NOTICE: You need to install golangci-lint manually to build this application https://github.com/golangci/golangci-lint#install"{{ else }}{{ end }}'
|
- '{{ if eq OS "windows" }} echo "NOTICE: You need to install golangci-lint manually to build this application https://github.com/golangci/golangci-lint#install"{{ else }}{{ end }}'
|
||||||
|
|
||||||
compile:
|
compile:
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
# Golang testing image with some tools already installed
|
|
||||||
FROM golang:1.13-alpine
|
FROM golang:1.13-alpine
|
||||||
|
|
||||||
LABEL maintainer="Tom Whiston <tom.whiston@gmail.com>"
|
|
||||||
|
|
||||||
ENV SEMAPHORE_VERSION="development" SEMAPHORE_ARCH="linux_amd64" \
|
ENV SEMAPHORE_VERSION="development" SEMAPHORE_ARCH="linux_amd64" \
|
||||||
SEMAPHORE_CONFIG_PATH="${SEMAPHORE_CONFIG_PATH:-/etc/semaphore}" \
|
SEMAPHORE_CONFIG_PATH="${SEMAPHORE_CONFIG_PATH:-/etc/semaphore}" \
|
||||||
APP_ROOT="/go/src/github.com/ansible-semaphore/semaphore/"
|
APP_ROOT="/go/src/github.com/ansible-semaphore/semaphore/"
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
||||||
echo "--> Turn off StrictKeyChecking"
|
echo "--> Turn off StrictKeyChecking"
|
||||||
cat > /etc/ssh/ssh_config <<EOF
|
cat > /etc/ssh/ssh_config <<EOF
|
||||||
Host *
|
Host *
|
||||||
|
@ -1,23 +1,21 @@
|
|||||||
# hadolint ignore=DL3006
|
FROM apiaryio/dredd:13.0.0
|
||||||
FROM tomwhiston/dredd:latest
|
|
||||||
|
|
||||||
ENV TASK_VERSION=v2.0.1 \
|
ENV SEMAPHORE_SERVICE=semaphore_ci \
|
||||||
GOPATH=/home/developer/go \
|
|
||||||
SEMAPHORE_SERVICE=semaphore_ci \
|
|
||||||
SEMAPHORE_PORT=3000 \
|
SEMAPHORE_PORT=3000 \
|
||||||
MYSQL_SERVICE=mysql \
|
MYSQL_SERVICE=mysql \
|
||||||
MYSQL_PORT=3306
|
MYSQL_PORT=3306
|
||||||
|
|
||||||
# We need the source and task to compile the hooks
|
RUN apk add --no-cache bash curl git go
|
||||||
USER 0
|
|
||||||
RUN dnf install -y nc
|
RUN (cd /usr && curl -sL https://taskfile.dev/install.sh | sh)
|
||||||
COPY deployment/docker/ci/dredd/entrypoint /usr/local/bin
|
|
||||||
COPY . /home/developer/go/src/github.com/ansible-semaphore/semaphore
|
# We need the source and task to compile the hooks
|
||||||
RUN (cd $(go env GOPATH) && curl -sL https://taskfile.dev/install.sh | sh) &&\
|
COPY . /semaphore/
|
||||||
chown -R developer /home/developer/go
|
|
||||||
|
WORKDIR /semaphore
|
||||||
|
|
||||||
# Get tools and do compile
|
|
||||||
WORKDIR /home/developer/go/src/github.com/ansible-semaphore/semaphore
|
|
||||||
RUN task deps:tools && task deps:be && task compile:be && task compile:api:hooks
|
RUN task deps:tools && task deps:be && task compile:be && task compile:api:hooks
|
||||||
|
|
||||||
|
COPY deployment/docker/ci/dredd/entrypoint /usr/local/bin
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/entrypoint"]
|
ENTRYPOINT ["/usr/local/bin/entrypoint"]
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "---> Add Config"
|
echo "---> Add Config"
|
||||||
cat > ./.dredd/config.json <<EOF
|
cat > /semaphore/.dredd/config.json <<EOF
|
||||||
{
|
{
|
||||||
"mysql": {
|
"mysql": {
|
||||||
"host": "${MYSQL_SERVICE}:${MYSQL_PORT}",
|
"host": "${MYSQL_SERVICE}:${MYSQL_PORT}",
|
||||||
@ -22,4 +22,4 @@ done
|
|||||||
echo "---> Run Dredd"
|
echo "---> Run Dredd"
|
||||||
# We do this because otherwise it can fail out
|
# We do this because otherwise it can fail out
|
||||||
sleep 5
|
sleep 5
|
||||||
/home/developer/node_modules/.bin/dredd $@
|
dredd $@
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# Golang testing image with some tools already installed
|
|
||||||
FROM golang:1.13-alpine
|
FROM golang:1.13-alpine
|
||||||
|
|
||||||
ENV SEMAPHORE_VERSION="development" SEMAPHORE_ARCH="linux_amd64" \
|
ENV SEMAPHORE_VERSION="development" SEMAPHORE_ARCH="linux_amd64" \
|
||||||
SEMAPHORE_CONFIG_PATH="${SEMAPHORE_CONFIG_PATH:-/etc/semaphore}" \
|
SEMAPHORE_CONFIG_PATH="${SEMAPHORE_CONFIG_PATH:-/etc/semaphore}" \
|
||||||
APP_ROOT="/go/src/github.com/ansible-semaphore/semaphore/"
|
APP_ROOT="/go/src/github.com/ansible-semaphore/semaphore/"
|
||||||
|
|
||||||
|
# hadolint ignore=DL3013
|
||||||
RUN apk add --no-cache git mysql-client python py-pip py-openssl openssl ca-certificates curl curl-dev openssh-client tini nodejs nodejs-npm bash rsync && \
|
RUN apk add --no-cache git mysql-client python py-pip py-openssl openssl ca-certificates curl curl-dev openssh-client tini nodejs nodejs-npm bash rsync && \
|
||||||
apk --update add --virtual build-dependencies python-dev libffi-dev openssl-dev build-base &&\
|
apk --update add --virtual build-dependencies python-dev libffi-dev openssl-dev build-base &&\
|
||||||
rm -rf /var/cache/apk/*
|
rm -rf /var/cache/apk/*
|
||||||
@ -28,9 +28,9 @@ RUN cd $(go env GOPATH) && curl -sL https://taskfile.dev/install.sh | sh
|
|||||||
# Copy in app source
|
# Copy in app source
|
||||||
WORKDIR ${APP_ROOT}
|
WORKDIR ${APP_ROOT}
|
||||||
COPY . ${APP_ROOT}
|
COPY . ${APP_ROOT}
|
||||||
RUN deployment/docker/dev/bin/install
|
RUN deployment/docker/ci/bin/install
|
||||||
|
|
||||||
USER 1000
|
USER semaphore
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
ENTRYPOINT ["/usr/local/bin/semaphore-wrapper"]
|
||||||
CMD ["task", "watch"]
|
CMD ["./bin/semaphore", "--config", "/etc/semaphore/config.json"]
|
||||||
|
@ -1,23 +1,27 @@
|
|||||||
# hadolint ignore=DL3006
|
FROM golang:1.13-alpine as golang
|
||||||
FROM tomwhiston/dredd:latest
|
|
||||||
|
|
||||||
ENV TASK_VERSION=v2.0.1 \
|
RUN apk add --no-cache curl git
|
||||||
GOPATH=/home/developer/go \
|
|
||||||
SEMAPHORE_SERVICE=semaphore_ci \
|
# We need the source and task to compile the hooks
|
||||||
|
COPY . /semaphore/
|
||||||
|
|
||||||
|
RUN (cd /usr && curl -sL https://taskfile.dev/install.sh | sh)
|
||||||
|
WORKDIR /semaphore
|
||||||
|
RUN task deps:tools && task deps:be && task compile:be && task compile:api:hooks
|
||||||
|
|
||||||
|
FROM apiaryio/dredd:13.0.0 as dredd
|
||||||
|
|
||||||
|
RUN apk add --no-cache bash
|
||||||
|
|
||||||
|
COPY --from=golang /semaphore /semaphore
|
||||||
|
|
||||||
|
WORKDIR /semaphore
|
||||||
|
|
||||||
|
COPY deployment/docker/ci/dredd/entrypoint /usr/local/bin
|
||||||
|
|
||||||
|
ENV SEMAPHORE_SERVICE=semaphore_ci \
|
||||||
SEMAPHORE_PORT=3000 \
|
SEMAPHORE_PORT=3000 \
|
||||||
MYSQL_SERVICE=mysql \
|
MYSQL_SERVICE=mysql \
|
||||||
MYSQL_PORT=3306
|
MYSQL_PORT=3306
|
||||||
|
|
||||||
# We need the source and task to compile the hooks
|
|
||||||
USER 0
|
|
||||||
RUN dnf install -y nc
|
|
||||||
COPY deployment/docker/ci/dredd/entrypoint /usr/local/bin
|
|
||||||
COPY . /home/developer/go/src/github.com/ansible-semaphore/semaphore
|
|
||||||
RUN (cd $(go env GOPATH) && curl -sL https://taskfile.dev/install.sh | sh) &&\
|
|
||||||
chown -R developer /home/developer/go
|
|
||||||
|
|
||||||
# Get tools and do compile
|
|
||||||
WORKDIR /home/developer/go/src/github.com/ansible-semaphore/semaphore
|
|
||||||
RUN task deps:tools && task deps:be && task compile:be && task compile:api:hooks
|
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/entrypoint"]
|
ENTRYPOINT ["/usr/local/bin/entrypoint"]
|
||||||
|
@ -1,26 +1,30 @@
|
|||||||
# ansible-semaphore production image
|
# ansible-semaphore production image
|
||||||
#
|
FROM golang:1.13-alpine3.10 as builder
|
||||||
# Uses frolvlad alpine so we have access to glibc which is needed for golang
|
|
||||||
# and when deploying in openshift
|
|
||||||
FROM frolvlad/alpine-glibc:alpine-3.7
|
|
||||||
|
|
||||||
LABEL maintainer="Tom Whiston <tom.whiston@gmail.com>"
|
LABEL maintainer="Tom Whiston <tom.whiston@gmail.com>"
|
||||||
|
|
||||||
RUN apk add --no-cache git ansible mysql-client curl openssh-client tini && \
|
COPY ./ /go/src/github.com/ansible-semaphore/semaphore
|
||||||
|
WORKDIR /go/src/github.com/ansible-semaphore/semaphore
|
||||||
|
|
||||||
|
RUN apk add --no-cache -U libc-dev curl nodejs npm git && \
|
||||||
|
./deployment/docker/prod/bin/install
|
||||||
|
|
||||||
|
# Uses frolvlad alpine so we have access to glibc which is needed for golang
|
||||||
|
# and when deploying in openshift
|
||||||
|
FROM frolvlad/alpine-glibc:alpine-3.10 as runner
|
||||||
|
|
||||||
|
RUN apk add --no-cache git curl ansible mysql-client openssh-client tini && \
|
||||||
adduser -D -u 1001 -G root semaphore && \
|
adduser -D -u 1001 -G root semaphore && \
|
||||||
mkdir -p /tmp/semaphore && \
|
mkdir -p /tmp/semaphore && \
|
||||||
mkdir -p /etc/semaphore && \
|
mkdir -p /etc/semaphore && \
|
||||||
chown -R semaphore:0 /tmp/semaphore && \
|
chown -R semaphore:0 /tmp/semaphore && \
|
||||||
chown -R semaphore:0 /etc/semaphore
|
chown -R semaphore:0 /etc/semaphore
|
||||||
|
|
||||||
COPY ./ /go/src/github.com/ansible-semaphore/semaphore
|
COPY --from=builder /usr/local/bin/semaphore-wrapper /usr/local/bin/
|
||||||
WORKDIR /go/src/github.com/ansible-semaphore/semaphore
|
COPY --from=builder /usr/local/bin/semaphore /usr/local/bin/
|
||||||
|
|
||||||
RUN apk add --no-cache -U libc-dev go nodejs && \
|
RUN chown -R semaphore:0 /usr/local/bin/semaphore-wrapper &&\
|
||||||
./deployment/docker/prod/bin/install && \
|
chown -R semaphore:0 /usr/local/bin/semaphore
|
||||||
apk del libc-dev go nodejs && \
|
|
||||||
rm -rf /go/* && \
|
|
||||||
rm -rf /var/cache/apk/*
|
|
||||||
|
|
||||||
WORKDIR /home/semaphore
|
WORKDIR /home/semaphore
|
||||||
USER 1001
|
USER 1001
|
||||||
|
@ -2,12 +2,6 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Go build environment
|
|
||||||
export GOROOT=/usr/lib/go
|
|
||||||
export GOPATH=/go
|
|
||||||
export GOBIN=/go/bin
|
|
||||||
export PATH="${PATH}:${GOBIN}"
|
|
||||||
|
|
||||||
# Get prerequisites for building the app
|
# Get prerequisites for building the app
|
||||||
(cd $(go env GOPATH) && curl -sL https://taskfile.dev/install.sh | sh)
|
(cd $(go env GOPATH) && curl -sL https://taskfile.dev/install.sh | sh)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user