Commit d29afb94 by Feanil Patel Committed by GitHub

Merge pull request #3678 from edx/feanil/gocd_upgrade

Feanil/gocd upgrade
parents 35c55e85 55da5be5
# Build using: docker build -f Dockerfile.gocd-agent -t gocd-agent .
FROM gocd/gocd-agent:16.5.0
FROM gocd/gocd-agent:17.1.0
LABEL version="0.02" \
description="This custom go-agent docker file installs additional requirements for the edx pipeline"
# Add Custom apt repositories
RUN \
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
add-apt-repository -y 'deb http://ppa.edx.org trusty main' && \
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 69464050 && \
apt-get update
# Install Java 7
RUN \
apt-get install -y oracle-java7-installer && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk7-installer
# Install a modern git client
RUN add-apt-repository -y ppa:git-core/ppa && \
apt-get update && \
......@@ -26,9 +12,6 @@ RUN add-apt-repository -y ppa:git-core/ppa && \
# Define working directory.
WORKDIR /data
# Define commonly used JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/java-7-oracle
# Install Python and package mgmt tools.
RUN apt-get update && apt-get install -y -q \
python \
......@@ -81,10 +64,6 @@ RUN \
# Install AWS command-line interface - for AWS operations in a go-agent task.
RUN pip install awscli
ADD docker/build/go-agent/files/go-agent-start.sh /etc/service/go-agent/run
ADD docker/build/go-agent/files/go-agent-env-vars /etc/default/go-agent
RUN update-java-alternatives -s java-7-oracle
# !!!!NOTICE!!!! ---- Runner of this pipeline take heed!! You must replace go_github_key.pem with the REAL key material
# that can checkout private github repositories used as pipeline materials. The key material here is faked and is only
# used to pass CI!
......
GO_SERVER=127.0.0.1
export GO_SERVER
GO_SERVER_PORT=8153
export GO_SERVER_PORT
GO_SERVER_SSL_PORT=8154
export GO_SERVER_SSL_PORT
AGENT_WORK_DIR=/var/lib/${SERVICE_NAME:-go-agent}
export AGENT_WORK_DIR
DAEMON=N
VNC=N
export JAVA_HOME="/usr/lib/jvm/java-7-oracle/jre" # SET_BY_GO_INSTALLER__DONT_REMOVE
\ No newline at end of file
#!/bin/bash
GO_SERVER=${GO_SERVER:-go-server}
GO_SERVER_PORT=${GO_SERVER_PORT:-go-server-port}
COLOR_START=""
COLOR_END=""
echo -e "${COLOR_START}Starting Go Agent to connect to server $GO_SERVER:$GO_SERVER_PORT ...${COLOR_END}"
sed -i -e 's/GO_SERVER=.*/GO_SERVER='$GO_SERVER'/' /etc/default/go-agent
sed -i -e 's/GO_SERVER_PORT=.*/GO_SERVER_PORT='$GO_SERVER_PORT'/' /etc/default/go-agent
sed -i -e 's/GO_SERVER_SSL_PORT=.*/GO_SERVER_SSL_PORT='$GO_SERVER_SSL_PORT'/' /etc/default/go-agent
mkdir -p /var/lib/go-agent/config
/bin/rm -f /var/lib/go-agent/config/autoregister.properties
AGENT_KEY="${AGENT_KEY:-123456789abcdef}"
echo "agent.auto.register.key=$AGENT_KEY" >/var/lib/go-agent/config/autoregister.properties
if [ -n "$AGENT_RESOURCES" ]; then echo "agent.auto.register.resources=$AGENT_RESOURCES" >>/var/lib/go-agent/config/autoregister.properties; fi
if [ -n "$AGENT_ENVIRONMENTS" ]; then echo "agent.auto.register.environments=$AGENT_ENVIRONMENTS" >>/var/lib/go-agent/config/autoregister.properties; fi
/sbin/setuser go /etc/init.d/go-agent start
\ No newline at end of file
......@@ -13,23 +13,23 @@
GO_SERVER_SERVICE_NAME: "go-server"
GO_SERVER_USER: "go"
GO_SERVER_GROUP: "{{ GO_SERVER_USER }}"
GO_SERVER_VERSION: "16.5.0-3305"
GO_SERVER_VERSION: "17.1.0-4511"
GO_SERVER_HOME: "/var/lib/go-server"
GO_SERVER_CONF_HOME: "/etc/go"
GO_SERVER_PLUGIN_DIR: "{{ GO_SERVER_HOME }}/plugins/external/"
# Java version settings
GO_SERVER_ORACLEJDK_VERSION: "7u80"
GO_SERVER_ORACLEJDK_BASE: "jdk1.7.0_80"
GO_SERVER_ORACLEJDK_BUILD: "b15"
GO_SERVER_ORACLEJDK_LINK: "/usr/lib/jvm/java-7-oracle"
GO_SERVER_ORACLEJDK_VERSION: "8u65"
GO_SERVER_ORACLEJDK_BASE: "jdk1.8.0_65"
GO_SERVER_ORACLEJDK_BUILD: "b17"
GO_SERVER_ORACLEJDK_LINK: "/usr/lib/jvm/java-8-oracle"
# java tuning
GO_SERVER_JAVA_HOME: "{{ GO_SERVER_ORACLEJDK_LINK }}"
# Aptitude settings
GO_SERVER_APT_SOURCE: "deb https://download.go.cd /"
GO_SERVER_APT_KEY_URL: "https://download.go.cd/GOCD-GPG-KEY.asc"
GO_SERVER_APT_SOURCE: "deb https://download.gocd.io /"
GO_SERVER_APT_KEY_URL: "https://download.gocd.io/GOCD-GPG-KEY.asc"
GO_SERVER_APT_NAME: "go-server"
GO_SERVER_APT_PKGS: ["apache2-utils"]
......
......@@ -16,7 +16,7 @@
# Deploys go-server using aptitude!
#
# Dependencies:
# - openjdk7
# - openjdk8
#
# Example play:
#
......@@ -69,8 +69,7 @@
mode: 0776
owner: "{{ GO_SERVER_USER }}"
group: "{{ GO_SERVER_GROUP }}"
# uncomment ansible has been upgraded to 2.0+
# checksum=md5:{{ item.md5 }}
checksum: "md5:{{ item.md5 }}"
with_items:
- { url: "{{ GO_SERVER_OAUTH_LOGIN_JAR_URL }}", md5: "{{ GO_SERVER_OAUTH_LOGIN_MD5 }}" }
- { url: "{{ GO_SERVER_GITHUB_PR_PLUGIN_JAR_URL }}", md5: "{{ GO_SERVER_GITHUB_PR_PLUGIN_MD5 }}" }
......@@ -98,7 +97,7 @@
owner: "{{ GO_SERVER_USER }}"
group: "{{ GO_SERVER_GROUP }}"
force: no
when: GO_SERVER_ADMIN_PASSWORD and GO_SERVER_BACKUP_PASSWORD AND GO_SERVER_GOMATIC_PASSWORD
when: GO_SERVER_ADMIN_PASSWORD and GO_SERVER_BACKUP_PASSWORD and GO_SERVER_GOMATIC_PASSWORD
- name: install go-server configuration
template:
......@@ -118,9 +117,9 @@
regexp: "^{{ item.username }}"
line: "{{ item.password_hash.stdout }}"
with_items:
- { username: GO_SERVER_ADMIN_USERNAME, password: GO_SERVER_ADMIN_PASSWORD, password_hash: admin_user_password_line }
- { username: GO_SERVER_BACKUP_USERNAME, password: GO_SERVER_BACKUP_PASSWORD, password_hash: backup_user_password_line }
- { username: GO_SERVER_GOMATIC_USERNAME, password: GO_SERVER_GOMATIC_PASSWORD, password_hash: gomatic_user_password_line }
- { username: "{{ GO_SERVER_ADMIN_USERNAME }}", password: "{{ GO_SERVER_ADMIN_PASSWORD }}", password_hash: "{{ admin_user_password_line }}" }
- { username: "{{ GO_SERVER_BACKUP_USERNAME }}", password: "{{ GO_SERVER_BACKUP_PASSWORD }}", password_hash: "{{ backup_user_password_line }}" }
- { username: "{{ GO_SERVER_GOMATIC_USERNAME }}", password: "{{ GO_SERVER_GOMATIC_PASSWORD }}", password_hash: "{{ gomatic_user_password_line }}" }
when: item.username and item.password and item.password_hash
- name: install ssh key for the secure repos
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment