Document setup, tweak to be non-annoying and not require reauth on restart

This commit is contained in:
Petr Mrazek 2019-09-15 00:29:25 +02:00
parent d2eb814dd9
commit c1ef6a7518
5 changed files with 68 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.env

9
README Normal file
View file

@ -0,0 +1,9 @@
# MultiMC builder setup
This describes how to set up MultiMC teamcity build agents so they aren't annoying.
1. Copy `env.example` to `.env`
2. Bring up all the machines with `docker-compose up` and observe the auth tokens they get from TC
3. Bring all the build agents down
4. Fill in the real auth token into `.env`
5. Bring the agents up, remove all dead ones from TC, authorize the running ones

39
agents/Dockerfile.site Normal file
View file

@ -0,0 +1,39 @@
# MultiMC 64-bit Linux Build Environment
# Add teamcity parts to an ancient base of Ubuntu 14.04
FROM ubuntu:trusty
MAINTAINER Petr Mrázek, peterix@gmail.com
VOLUME /data/teamcity_agent/conf
ENV LANG en_US.UTF-8
ENV CONFIG_FILE /data/teamcity_agent/conf/buildAgent.properties
COPY run-agent.sh /run-agent.sh
COPY run-services.sh /run-services.sh
COPY buildagent /opt/buildagent
RUN apt-get update
RUN apt-get install -y --no-install-recommends sudo
RUN useradd -m buildagent
RUN chmod +x /opt/buildagent/bin/*.sh
RUN chmod +x /run-agent.sh /run-services.sh
RUN mv /opt/buildagent/conf /opt/buildagent/conf_dist && sync
# We need "apt-add-repository"
RUN apt-get install -y software-properties-common python-software-properties curl
# Install Java
RUN add-apt-repository ppa:openjdk-r/ppa
RUN apt-get update
RUN apt-get install -y openjdk-8-jdk
CMD ["/run-services.sh"]
EXPOSE 9090
# Download and install hugo
ENV HUGO_VERSION 0.31.1
ENV HUGO_BINARY hugo_${HUGO_VERSION}_Linux-64bit.deb
ADD https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/${HUGO_BINARY} /tmp/hugo.deb
RUN dpkg -i /tmp/hugo.deb && rm /tmp/hugo.deb

View file

@ -7,6 +7,8 @@ services:
environment:
- "SERVER_URL=http://server:8111"
- AGENT_NAME=Trusty64
- AGENT_TOKEN=${TOKEN_TRUSTY64}
- RUN_AS_BUILDAGENT=true
hostname: trusty-64
networks:
- teamcity_internal
@ -17,9 +19,23 @@ services:
environment:
- "SERVER_URL=http://server:8111"
- AGENT_NAME=Trusty32
- AGENT_TOKEN=${TOKEN_TRUSTY32}
- RUN_AS_BUILDAGENT=true
hostname: trusty-32
networks:
- teamcity_internal
site:
build:
context: agents
dockerfile: Dockerfile.site
environment:
- "SERVER_URL=http://server:8111"
- AGENT_NAME=Site
- AGENT_TOKEN=${TOKEN_SITE}
- RUN_AS_BUILDAGENT=true
hostname: site
networks:
- teamcity_internal
networks:
teamcity_internal:

3
env.example Normal file
View file

@ -0,0 +1,3 @@
TOKEN_TRUSTY32=token1
TOKEN_TRUSTY64=token2
TOKEN_SITE=token3