mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 13:31:54 +00:00
dev/sg: add 'sg run server' alias (#38256)
Convenient for running end-to-end tests the same way we run them in CI.
This commit is contained in:
parent
a79eba4791
commit
da23651ade
@ -2,7 +2,8 @@
|
||||
# This runs a published or local server image for testing and development purposes.
|
||||
|
||||
IMAGE=${IMAGE:-sourcegraph/server:${TAG:-insiders}}
|
||||
URL=${URL:-"http://localhost:7080"}
|
||||
PORT=${PORT:-"7080"}
|
||||
URL="http://localhost:$PORT"
|
||||
DATA=${DATA:-"/tmp/sourcegraph-data"}
|
||||
|
||||
echo "--- Checking for existing Sourcegraph instance at $URL"
|
||||
@ -31,9 +32,9 @@ if [ "$clean" != "n" ] && [ "$clean" != "N" ]; then
|
||||
rm -rf "$DATA"
|
||||
fi
|
||||
|
||||
echo "--- Starting server ${IMAGE}"
|
||||
echo "--- Starting server ${IMAGE} on port ${PORT}"
|
||||
docker run "$@" \
|
||||
--publish 7080:7080 \
|
||||
--publish "$PORT":7080 \
|
||||
-e SRC_LOG_LEVEL=dbug \
|
||||
-e DEBUG=t \
|
||||
--volume "$DATA/config:/etc/sourcegraph" \
|
||||
|
||||
@ -108,6 +108,7 @@ Available commands in `sg.config.yaml`:
|
||||
* redis-postgres
|
||||
* repo-updater
|
||||
* searcher
|
||||
* server
|
||||
* storybook
|
||||
* symbols
|
||||
* syntax-highlighter
|
||||
|
||||
@ -115,6 +115,14 @@ env:
|
||||
ENABLE_STREAMING_REPOS_SYNCER: true
|
||||
|
||||
commands:
|
||||
server:
|
||||
cmd: ./dev/run-server-image.sh
|
||||
env:
|
||||
TAG: insiders
|
||||
CLEAN: 'true'
|
||||
DATA: '/tmp/sourcegraph-data'
|
||||
URL: 'http://localhost:7080'
|
||||
|
||||
oss-frontend:
|
||||
cmd: .bin/oss-frontend
|
||||
install: |
|
||||
@ -964,7 +972,10 @@ tests:
|
||||
|
||||
frontend-e2e:
|
||||
preamble: |
|
||||
'sg start enterprise-e2e' must be already running for these tests to work.
|
||||
'sg start enterprise-e2e' must be already running for these tests to work. You can also
|
||||
run tests against an existing server image:
|
||||
|
||||
TAG=insiders sg run server
|
||||
|
||||
If you run into authentication issues, you can run the following commands to fix them:
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user