test: use env for key enc

This commit is contained in:
Denis Gukov 2022-11-09 12:26:15 +05:00
parent adb57bf524
commit 7497aa5818
7 changed files with 12 additions and 75 deletions

View File

@ -75,16 +75,4 @@ The most basic configuration for this using a local docker container to run the
"name": "semaphore"
}
}
```
It is strongly advised to run these tests inside docker containers, as dredd will write a lot of test information and will __NOT__ clear it up.
This means that you should never run these tests against your productive database!
The best practice to run these tests is to use docker and the task commands.
```bash
context=dev task dc:build #build fresh semaphore images
context=dev task dc:up #up semaphore and mysql
task dc:build:dredd #build fresh dredd image
task dc:up:dredd #run dredd over docker-compose stack
```

View File

@ -232,26 +232,6 @@ tasks:
args: stop
context: "{{ .context }}"
dc:build:dredd:
desc: build a dredd container to the local testing with docker-compose stack
cmds:
- task: docker
vars:
context: dev
compose: true
prefix: -dredd
args: build
dc:up:dredd:
desc: build a dredd container to the local testing with docker-compose stack
cmds:
- task: docker
vars:
context: dev
compose: true
prefix: -dredd
args: up
docker:build:
desc: Build an image for Semaphore, requires context
vars:

View File

@ -8,9 +8,6 @@ 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"
@ -31,6 +28,7 @@ services:
SEMAPHORE_ADMIN_EMAIL: admin@localhost
SEMAPHORE_ADMIN: admin
SEMAPHORE_WEB_ROOT: http://0.0.0.0:3000
SEMAPHORE_ACCESS_KEY_ENCRYPTION: "IlRqgrrO5Gp27MlWakDX1xVrPv4jhoUx+ARY+qGyDxQ="
ports:
- "3000:3000"
depends_on:
@ -39,6 +37,8 @@ services:
dredd:
image: ansiblesemaphore/dredd:ci
command: ["--config", ".dredd/dredd.yml"]
environment:
SEMAPHORE_ACCESS_KEY_ENCRYPTION: "IlRqgrrO5Gp27MlWakDX1xVrPv4jhoUx+ARY+qGyDxQ="
build:
context: ./../../../
dockerfile: ./deployment/docker/ci/dredd.Dockerfile

View File

@ -10,7 +10,8 @@ cat > /semaphore/.dredd/config.json <<EOF
"user": "semaphore",
"pass": "semaphore",
"name": "semaphore"
}
},
"access_key_encryption": "${SEMAPHORE_ACCESS_KEY_ENCRYPTION}"
}
EOF

View File

@ -1,4 +1,10 @@
# How to test semaphore-wrapper
# semaphore-wrapper
## What it does
`semaphore-wrapper` generates `config.json` using `setup` command and execute provided command.
## How to test semaphore-wrapper
```bash
SEMAPHORE_DB_DIALECT=bolt \

View File

@ -1,11 +0,0 @@
version: '2'
services:
dredd:
image: ansiblesemaphore/dredd:dev-compose
command: ["--config", ".dredd/dredd.dev.yml"]
build:
context: ./../../../
dockerfile: ./deployment/docker/dev/dredd.Dockerfile
network_mode: "host"

View File

@ -1,27 +0,0 @@
FROM golang:1.18.3-alpine3.16 as golang
RUN apk add --no-cache curl git
# 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 \
MYSQL_SERVICE=mysql \
MYSQL_PORT=3306
ENTRYPOINT ["/usr/local/bin/entrypoint"]