Compare commits

...
Author SHA1 Message Date
dboreham 4256150ed4 Use gitea not gitee 2023-03-16 12:42:49 -06:00
dboreham 758303acfd Remove example creds 2023-03-16 12:28:58 -06:00
dboreham 313677fcf2 Initial version 2023-03-16 12:27:23 -06:00
dboreham 2291b2be8f Merge pull request #12 from cerc-io/dboreham/postgres-container-uid-fix
Override uid/gid of files created in the data dir
2023-02-28 10:23:00 -07:00
dboreham 506f2d35bf Override uid/gid of files created in the data dir 2023-02-28 10:19:42 -07:00
dboreham d74a637189 Merge pull request #11 from cerc-io/dboreham/usability-fixes
Add helpful messages
2023-02-28 09:23:11 -07:00
dboreham 85f9bb3d26 Add helfup messages 2023-02-28 09:00:09 -07:00
dboreham 81f8fe7df0 Merge pull request #9 from cerc-io/dboreham/remove-container-name
Remove extraneous container name
2023-02-28 08:44:53 -07:00
dboreham f6c4d722ef Remove extraneous container name 2023-02-28 08:39:47 -07:00
dboreham aead04bae0 Add sleep hack for gitea 2023-02-17 15:30:55 -07:00
dboreham 3d5a23819b Merge pull request #8 from cerc-io/dboreham/so-integration
Integrate with stack orchestrator
2023-02-17 15:24:45 -07:00
5 changed files with 46 additions and 3 deletions
+32
View File
@@ -0,0 +1,32 @@
# Deploy drone CI system
services:
drone:
image: drone/drone:2
environment:
- DRONE_GITEA_SERVER=http://gitea.local
- DRONE_GITEA_CLIENT_ID=put_the_real_client_id_here
- DRONE_GITEA_CLIENT_SECRET=put_the_real_secret_here
- DRONE_RPC_SECRET=super-duper-secret
- DRONE_SERVER_HOST=gitea.local # TODO: make this more generic
- DRONE_SERVER_PROTO=http
restart: always
volumes:
- ./drone:/data
ports:
- 80
- 443
drone-runner:
image: drone/drone-runner-docker:1
environment:
- DRONE_RPC_PROTO=http
- DRONE_RPC_HOST=drone
- DRONE_RPC_SECRET=super-duper-secret
- DRONE_RUNNER_CAPACITY=2
- DRONE_RUNNER_NAME=drone-runner-1
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 3000
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
if [[ -n "$CERC_SCRIPT_DEBUG" ]]; then
set -x
fi
mkdir -p ./drone
+5 -2
View File
@@ -1,5 +1,6 @@
version: "3"
# TODO: remove version since it is now redundant
# remove this network definition unless there's a reason for it
networks:
gitea:
external: false
@@ -7,7 +8,6 @@ networks:
services:
server:
image: gitea/gitea:1.18.3
container_name: gitea
environment:
- USER_UID=1000
- USER_GID=1000
@@ -41,6 +41,9 @@ services:
- POSTGRES_USER=gitea
- POSTGRES_PASSWORD=gitea
- POSTGRES_DB=gitea
# Workaround below for lack of docker uid mapping. Change the container's postgres user's uid/gid to match the host user's
entrypoint: bash
command: -c 'usermod -u ${CERC_HOST_UID:-1000} postgres;groupmod -g ${CERC_HOST_GID:-1000} postgres;exec /usr/local/bin/docker-entrypoint.sh postgres'
networks:
- gitea
volumes:
+4
View File
@@ -24,6 +24,8 @@ if [[ $? == 1 ]] ; then
# Then create if it wasn't found
${compose_command} exec --user git server gitea admin user create --admin --username ${GITEA_USER} --password ${GITEA_PASSWORD} --email ${GITEA_USER_EMAIL}
fi
# HACK: sleep a bit because if we don't gitea will return empty responses
sleep 5
# Check if the token already exists
token_response=$( curl -s "${GITEA_URL_PREFIX}/api/v1/users/${GITEA_USER}/tokens" \
-u ${GITEA_USER}:${GITEA_PASSWORD} \
@@ -45,6 +47,7 @@ if [[ ${token_found} != 1 ]] ; then
-d '{"name":"'${CERC_GITEA_TOKEN_NAME}'"}' \
| jq -r .sha1 )
echo "This is your gitea access token: ${new_gitea_token}. Keep it safe and secure, it can not be fetched again from gitea."
echo "To use with laconic-so set this environment variable: export CERC_NPM_AUTH_TOKEN=${new_gitea_token}"
CERC_GITEA_AUTH_TOKEN=${new_gitea_token}
else
# If the token exists, then we must have been passed its value.
@@ -73,4 +76,5 @@ if [[ $? != 0 ]] ; then
-d '{"username": "'${GITEA_NEW_ORGANIZATION}'"}' > /dev/null
echo "Created the organization ${GITEA_NEW_ORGANIZATION}"
fi
echo "Gitea was configured to use host name: gitea.local, ensure that this resolves to localhost, e.g. with sudo vi /etc/hosts"
echo "Success, gitea is properly initialized"
-1
View File
@@ -4,4 +4,3 @@ if [[ -n "$CERC_SCRIPT_DEBUG" ]]; then
fi
mkdir -p ./gitea
mkdir -p ./gitea/ssh
mkdir -p ./postgres