Last active
July 14, 2017 13:54
-
-
Save jmcdice/fe15cc5ed053d57146d1961a76d833af to your computer and use it in GitHub Desktop.
Install and start concourse on Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function get_binary() { | |
wget https://github.com/concourse/bin/releases/download/v2.8.0-rc.125/concourse_linux_amd64 -O /usr/sbin/concourse | |
chmod 755 /usr/sbin/concourse | |
} | |
function create_keys() { | |
ssh-keygen -t rsa -f tsa_host_key -N '' | |
ssh-keygen -t rsa -f worker_key -N '' | |
ssh-keygen -t rsa -f session_signing_key -N '' | |
cp worker_key.pub authorized_worker_keys | |
} | |
function install_pgsql() { | |
apt-get update | |
apt-get -y install postgresql | |
} | |
function config_pgsql() { | |
#sudo -u postgres createuser concourse | |
sudo -u postgres psql -U postgres -d postgres -c "alter user postgres with password 'h3ll000';" &> /dev/null | |
sudo -u postgres createdb atc &> /dev/null | |
} | |
function start_concourse_web() { | |
concourse web \ | |
--basic-auth-username myuser \ | |
--basic-auth-password mypass \ | |
--session-signing-key session_signing_key \ | |
--tsa-host-key tsa_host_key \ | |
--tsa-authorized-keys authorized_worker_keys \ | |
--postgres-data-source postgres://postgres:[email protected]/atc \ | |
--bind-port 80 2>&1 > /var/log/concourse-web & | |
#--external-url http://10.85.55.91/ 2>&1 > /var/log/concourse-web & | |
} | |
function start_concourse_worker() { | |
sudo concourse worker \ | |
--work-dir /opt/concourse/worker \ | |
--tsa-host 127.0.0.1 \ | |
--tsa-public-key tsa_host_key.pub \ | |
--tsa-worker-private-key worker_key 2>&1 > /var/log/concourse-worker & | |
} | |
get_binary | |
create_keys | |
install_pgsql | |
config_pgsql | |
start_concourse_web | |
start_concourse_worker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment