From 7bab8e03322003e074d460780088f999b5a65eb2 Mon Sep 17 00:00:00 2001 From: Anton Markelov Date: Mon, 22 Oct 2018 12:13:59 +1000 Subject: [PATCH] add dredd to dev dc environment --- deployment/docker/ci/docker-compose.yml | 3 +++ .../docker/dev/docker-compose-dredd.yml | 12 ++++++++++ deployment/docker/dev/docker-compose.yml | 4 +++- deployment/docker/dev/dredd.Dockerfile | 24 +++++++++++++++++++ public/vendor | 1 + 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 deployment/docker/dev/docker-compose-dredd.yml create mode 100644 deployment/docker/dev/dredd.Dockerfile create mode 160000 public/vendor diff --git a/deployment/docker/ci/docker-compose.yml b/deployment/docker/ci/docker-compose.yml index 7626975f..32cee642 100644 --- a/deployment/docker/ci/docker-compose.yml +++ b/deployment/docker/ci/docker-compose.yml @@ -8,6 +8,9 @@ services: MYSQL_DATABASE: semaphore MYSQL_USER: semaphore MYSQL_PASSWORD: semaphore + ## uncomment if you want to store mysql data between launches + #volumes: + # - /tmp/mysql_data:/var/lib/mysql ports: - "3306:3306" diff --git a/deployment/docker/dev/docker-compose-dredd.yml b/deployment/docker/dev/docker-compose-dredd.yml new file mode 100644 index 00000000..1fade045 --- /dev/null +++ b/deployment/docker/dev/docker-compose-dredd.yml @@ -0,0 +1,12 @@ +version: '2' + +services: + + dredd: + image: ansiblesemaphore/dredd:dev-compose + command: ["--config", ".dredd/dredd.yml"] + build: + context: ./../../../ + dockerfile: ./deployment/docker/dev/dredd.Dockerfile + external_links: + - dev_semaphore_dev_1:semaphore_dev \ No newline at end of file diff --git a/deployment/docker/dev/docker-compose.yml b/deployment/docker/dev/docker-compose.yml index cf641bf6..8b67e9aa 100644 --- a/deployment/docker/dev/docker-compose.yml +++ b/deployment/docker/dev/docker-compose.yml @@ -8,6 +8,9 @@ services: MYSQL_DATABASE: semaphore MYSQL_USER: semaphore MYSQL_PASSWORD: semaphore + ## uncomment if you want to store mysql data between launches + #volumes: + # - /tmp/mysql_data:/var/lib/mysql ports: - "3306:3306" @@ -34,4 +37,3 @@ services: - "3000:3000" depends_on: - mysql - diff --git a/deployment/docker/dev/dredd.Dockerfile b/deployment/docker/dev/dredd.Dockerfile new file mode 100644 index 00000000..70544174 --- /dev/null +++ b/deployment/docker/dev/dredd.Dockerfile @@ -0,0 +1,24 @@ +# hadolint ignore=DL3006 +FROM tomwhiston/dredd:latest + +ENV TASK_VERSION=v2.0.1 \ + GOPATH=/home/developer/go \ + SEMAPHORE_SERVICE=semaphore_dev \ + SEMAPHORE_PORT=3000 \ + MYSQL_SERVICE=mysql \ + 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 +WORKDIR /usr/local/bin +RUN curl -L "https://github.com/go-task/task/releases/download/${TASK_VERSION}/task_linux_amd64.tar.gz" | tar xvz && \ + 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"] \ No newline at end of file diff --git a/public/vendor b/public/vendor new file mode 160000 index 00000000..31cbac89 --- /dev/null +++ b/public/vendor @@ -0,0 +1 @@ +Subproject commit 31cbac89f1465de60797d2879addc8c71de93d1b