diff --git a/CloudronManifest.json b/CloudronManifest.json index 4ad50cf..e296dea 100644 --- a/CloudronManifest.json +++ b/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 ", - "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, diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0817bd2 --- /dev/null +++ b/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 diff --git a/POSTINSTALL.md b/POSTINSTALL.md index 9e26089..3968176 100644 --- a/POSTINSTALL.md +++ b/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: diff --git a/README.md b/README.md index f258878..1888ac9 100644 --- a/README.md +++ b/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. diff --git a/concourse_worker.sh b/concourse_worker.sh index b593a0d..5050c6c 100755 --- a/concourse_worker.sh +++ b/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 diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..82439b9 Binary files /dev/null and b/logo.png differ diff --git a/start.sh b/start.sh index d35e429..0778bcc 100755 --- a/start.sh +++ b/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