Browse Source

Add Makefile and update manifest and docs

develop
IamTheFij 4 years ago
parent
commit
874e819351
  1. 12
      CloudronManifest.json
  2. 24
      Makefile
  3. 10
      POSTINSTALL.md
  4. 6
      README.md
  5. 24
      concourse_worker.sh
  6. BIN
      logo.png
  7. 8
      start.sh

12
CloudronManifest.json

@ -1,10 +1,12 @@
{
"id": "com.concourse",
"id": "io.concourse.cloudron",
"title": "Concourse",
"description": "Automated CI tool",
"tagline": "Deploy it all",
"author": "Ian Fijolek <ian@iamthefij.com>",
"website": "https://ghost.iamthefij.com/",
"description": "file://DESCRIPTION.md",
"tagline": "CI that scales with your project",
"postInstallMessage": "file://POSTINSTALL.md",
"icon": "file://logo.png",
"author": "Concourse Developers",
"website": "https://concourse.ci/",
"version": "0.0.1",
"healthCheckPath": "/",
"httpPort": 8080,

24
Makefile

@ -0,0 +1,24 @@
.PHONY: build
default: build
build:
cloudron build
install: build
cloudron install
uninstall:
cloudron uninstall
run: install
cloudron logs && cloudron logs -f
debug:
cloudron configure --debug
no-debug:
cloudron configure --no-debug
startworker:
./concourse_worker.sh

10
POSTINSTALL.md

@ -1,11 +1,13 @@
# Postinstall
### Running workers
In order to run builds, you will need to set up a worker somewhere. Since this requires `sudo` and/or Docker running as `privileged`, it cannot be started by Cloudron and requires this manual step. It's easiest to do this with Docker on the same host. Executing the following commands will start up your worker connected to your main Concourse application.
tsa_container=$(cloudron list | awk '/com.concourse/{print $1;}')
tsa_container=$(cloudron list | awk '/io.concourse.cloudron/{print $1;}')
tsa_hostname=$(cloudron exec --app $tsa_container env | grep HOSTNAME | sed s/.*=//)
tsa_port=$(cloudron exec --app $tsa_container env | grep TSA_PORT | sed s/.*=//)
docker run \
--rm \
--name concourse_worker \
--privileged \
--network cloudron \
--volumes-from $tsa_container \
@ -17,8 +19,8 @@ In order to run builds, you will need to set up a worker somewhere. Since this r
If you wish to do this with the binary or on another server, you will need to download your keys to facilitate the connection. This can be done using the following commands:
cloudron pull /app/data/worker_key
cloudron pull /app/data/tsa_host_key.pub
cloudron pull /app/data/worker_key ./
cloudron pull /app/data/tsa_host_key.pub ./
Then run a worker either with the binary, you should be able to execute the following from any server:

6
README.md

@ -1,3 +1,7 @@
# concourse-app
Cloudron packaged version of Concourse TSA
Cloudron packaged version of Concourse ATC/TSA
### Legal
Concourse is a trademark of Concourse in the U.S. and other countries.

24
concourse_worker.sh

@ -1,15 +1,17 @@
#! /bin/bash
tsa_container=$(cloudron list | awk '/com.concourse/{print $1;}')
# This is used to debug and will not daemonize or restart
# To run this in production remove the `--rm` flag and replace with `-d --restart unless-stopped`
tsa_container=$(cloudron list | awk '/io.concourse.cloudron/{print $1;}')
tsa_hostname=$(cloudron exec --app $tsa_container env | grep HOSTNAME | sed s/.*=//)
tsa_port=$(cloudron exec --app $tsa_container env | grep TSA_PORT | sed s/.*=//)
sudo docker run --rm \
--privileged \
--network cloudron \
--volumes-from $tsa_container \
concourse/concourse worker \
--tsa-host $tsa_hostname \
--tsa-port $tsa_port \
--tsa-public-key /app/data/tsa_host_key.pub \
--tsa-worker-private-key /app/data/worker_key
sudo docker run -d \
--name concourse_worker \
--privileged \
--network cloudron \
--volumes-from $tsa_container \
concourse/concourse worker \
--tsa-host $tsa_hostname \
--tsa-port $tsa_port \
--tsa-public-key /app/data/tsa_host_key.pub \
--tsa-worker-private-key /app/data/worker_key

BIN
logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

8
start.sh

@ -1,9 +1,7 @@
#! /bin/bash
set -e
# Chown necessary directories here since these are volumes
chown -R cloudron:cloudron /app/data /run
# Verify init with keys
if ! [ -f /app/data/.initialized ]; then
echo "First time init!"
@ -14,10 +12,14 @@ if ! [ -f /app/data/.initialized ]; then
cp /app/data/worker_key.pub /app/data/authorized_worker_keys
touch /app/data/.initialized
echo "Done with init. Starting"
else
echo "Already initialized. Starting"
fi
# Chown necessary directories here since these are volumes
chown -R cloudron:cloudron /app/data /run
export CONCOURSE_EXTERNAL_URL=$APP_ORIGIN
export CONCOURSE_POSTGRES_HOST=$POSTGRESQL_HOST
export CONCOURSE_POSTGRES_PORT=$POSTGRESQL_PORT

Loading…
Cancel
Save