Merge branch 'add-chrome-61' into 'master'

Lock yarn dependency, fix chrome dependency, upgrade node

Closes #14

See merge request gitlab-org/gitlab-build-images!56
This commit is contained in:
Stan Hu 2017-09-16 05:53:16 +00:00
commit 8f9eb89f81
6 changed files with 54 additions and 36 deletions

View file

@ -55,13 +55,12 @@ ruby-2.3.3-git-2.7-phantomjs-2.1-node-7.1 test: *test_custom
ruby-2.3.3-golang-1.8-git-2.7-phantomjs-2.1-node-7.1 test: *test_custom
ruby-2.3.3-golang-1.8-git-2.7-phantomjs-2.1-node-7.1-postgresql-9.6 test: *test_custom
ruby-2.3.3-golang-1.8-git-2.13-phantomjs-2.1-node-7.1-postgresql-9.6 test: *test_custom
ruby-2.3.3-golang-1.8-git-2.7-chrome-60.0-node-7.1-postgresql-9.6 test: *test_custom
ruby-2.3.3-golang-1.8-git-2.13-chrome-60.0-node-7.1-postgresql-9.6 test: *test_custom
ruby-2.3.3-golang-1.8-git-2.13-phantomjs-2.1-node-8.x-yarn-1.0-postgresql-9.6 test: *test_custom
ruby-2.3.3-golang-1.8-git-2.13-chrome-61.0-node-8.x-yarn-1.0-postgresql-9.6 test: *test_custom
ruby-2.4.1-golang-1.8-git-2.7-phantomjs-2.1-node-7.1-postgresql-9.6 test: *test_custom
golang-1.8-git-2.8.4 test: *test_custom
golang-1.8-git-2.13 test: *test_custom
ruby-2.3.3-golang-1.8-git-2.13-chrome-59.0-node-7.1-postgresql-9.6 test: *test_build
www-gitlab-com test: *test_build
gitlab-qa test: *test_build
omnibus-gitlab-centos6 test: *test_build
@ -83,13 +82,12 @@ ruby-2.3.3-git-2.7-phantomjs-2.1-node-7.1: *build_and_deploy_custom
ruby-2.3.3-golang-1.8-git-2.7-phantomjs-2.1-node-7.1: *build_and_deploy_custom
ruby-2.3.3-golang-1.8-git-2.7-phantomjs-2.1-node-7.1-postgresql-9.6: *build_and_deploy_custom
ruby-2.3.3-golang-1.8-git-2.13-phantomjs-2.1-node-7.1-postgresql-9.6: *build_and_deploy_custom
ruby-2.3.3-golang-1.8-git-2.7-chrome-60.0-node-7.1-postgresql-9.6: *build_and_deploy_custom
ruby-2.3.3-golang-1.8-git-2.13-chrome-60.0-node-7.1-postgresql-9.6: *build_and_deploy_custom
ruby-2.3.3-golang-1.8-git-2.13-phantomjs-2.1-node-8.x-yarn-1.0-postgresql-9.6: *build_and_deploy_custom
ruby-2.3.3-golang-1.8-git-2.13-chrome-61.0-node-8.x-yarn-1.0-postgresql-9.6: *build_and_deploy_custom
ruby-2.4.1-golang-1.8-git-2.7-phantomjs-2.1-node-7.1-postgresql-9.6: *build_and_deploy_custom
golang-1.8-git-2.8.4: *build_and_deploy_custom
golang-1.8-git-2.13: *build_and_deploy_custom
ruby-2.3.3-golang-1.8-git-2.13-chrome-59.0-node-7.1-postgresql-9.6: *build_and_deploy
www-gitlab-com: *build_and_deploy
gitlab-qa: *build_and_deploy
omnibus-gitlab-centos6: *build_and_deploy
@ -101,3 +99,21 @@ omnibus-gitlab-trusty: *build_and_deploy
omnibus-gitlab-wheezy: *build_and_deploy
omnibus-gitlab-xenial: *build_and_deploy
# Old Google Chrome images are listed here for reference:
# These still exist in our docker repisotiry, but they cannot be built anymore since
# Google yanks them from their PPA. To build variations of these requires an image based on
# one of the images below.
# See https://gitlab.com/gitlab-org/gitlab-build-images/merge_requests/54 for an example
# ruby-2.3.3-golang-1.8-git-2.7-chrome-59.0-node-7.1-postgresql-9.6: *test_custom
# ruby-2.3.3-golang-1.8-git-2.7-chrome-60.0-node-7.1-postgresql-9.6: *test_custom
# ruby-2.3.3-golang-1.8-git-2.13-chrome-59.0-node-7.1-postgresql-9.6: *test_custom
# ruby-2.3.3-golang-1.8-git-2.13-chrome-60.0-node-7.1-postgresql-9.6: *test_custom
# ruby-2.3.3-golang-1.8-git-2.7-chrome-59.0-node-7.1-postgresql-9.6: *build_and_deploy_custom
# ruby-2.3.3-golang-1.8-git-2.7-chrome-60.0-node-7.1-postgresql-9.6: *build_and_deploy_custom
# ruby-2.3.3-golang-1.8-git-2.13-chrome-59.0-node-7.1-postgresql-9.6: *build_and_deploy_custom
# ruby-2.3.3-golang-1.8-git-2.13-chrome-60.0-node-7.1-postgresql-9.6: *build_and_deploy_custom

View file

@ -27,9 +27,10 @@ RUN if [ -n "$CHROME_VERSION" ]; then /scripts/install-chrome $CHROME_VERSION &&
ARG PHANTOMJS_VERSION
RUN if [ -n "$PHANTOMJS_VERSION" ] ; then /scripts/install-phantomjs $PHANTOMJS_VERSION; fi
# NodeJS
# NodeJS and Yarn
ARG NODE_VERSION
RUN if [ -n "$NODE_VERSION" ] ; then /scripts/install-node $NODE_VERSION && node --version; fi
ARG YARN_VERSION
RUN if [ -n "$NODE_VERSION" ] ; then /scripts/install-node $NODE_VERSION $YARN_VERSION && node --version && yarn --version; fi
# Golang
ARG GOLANG_VERSION

View file

@ -1,23 +0,0 @@
#
# This build needs to be based on an older build as it's not possible to install Chrome 59.0 from
# Google's linux repositories any longer
#
FROM registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.3.3-golang-1.8-git-2.7-chrome-59.0-node-7.1-postgresql-9.6
ADD / /
RUN /scripts/install-essentials
ENV PATH $PATH:/usr/local/go/bin
# Git
ARG GIT_VERSION=2.13.0
ARG GIT_DOWNLOAD_URL=https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz
ARG GIT_DOWNLOAD_SHA256=9f2fa8040ebafc0c2caae4a9e2cb385c6f16c0525bcb0fbd84938bc796372e80
RUN /scripts/install-git && git --version
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

View file

@ -49,8 +49,9 @@ options are:
2. `git`
3. `chrome`
4. `node`
5. `phantomjs`
6. `postgres`
5. `yarn`
6. `phantomjs`
7. `postgres`
### Adding a new build
@ -59,3 +60,14 @@ the name would be `ruby-2.4-golang-1.9-git-2.14`.
1. Add a test task: `ruby-2.4-golang-1.9-git-2.14 test: *test_custom`
1. Add a new build task: `ruby-2.4-golang-1.9-git-2.14: *build_and_deploy_custom`
# Note regarding Google Chrome
Google has a policy of yanking older versions of Google Chrome from their PPA whenever a new major
version is released. This means images with non-current chrome versions will fail to build. Until
a better solution is worked out, we will remove images based on older Chrome versions from the build
process, but preserve them for reference within a comment in the `.gitlab-ci.yml` file.
These images will persist in the docker repository for legacy use, but will no longer be recompiled.
If an update ever needs to be made to an image containing an older version of Chrome, a workaround
can be modeled after https://gitlab.com/gitlab-org/gitlab-build-images/merge_requests/54

View file

@ -20,6 +20,7 @@ function print_golang_args() {
function print_chrome_args() {
case "$1" in
60|60.0) CHROME_VERSION=60.0.3112.90-1 ;;
61|61.0) CHROME_VERSION=61.0.3163.91-1 ;;
*) echo "Unknown chrome version $1"; exit 1;
esac
printf -- "--build-arg CHROME_VERSION=%s " "$CHROME_VERSION"
@ -57,12 +58,21 @@ function print_phantomjs_args() {
function print_node_args() {
case "$1" in
7.1) NODE_VERSION=7.x ;;
*) echo "Unknown chrome version $1"; exit 1;
7.x|7.1) NODE_VERSION=7.x ;;
8.x) NODE_VERSION=8.x ;;
*) echo "Unknown node version $1"; exit 1;
esac
printf -- "--build-arg NODE_VERSION=%s " "$NODE_VERSION"
}
function print_yarn_args() {
case "$1" in
1.0) YARN_VERSION=1.0.2-1 ;;
*) echo "Unknown yarn version $1"; exit 1;
esac
printf -- "--build-arg YARN_VERSION=%s " "$YARN_VERSION"
}
function print_postgres_args() {
printf -- "--build-arg POSTGRES_VERSION=%s " "$1"
}
@ -81,6 +91,7 @@ function parse_arguments() {
git) print_git_args $version ;;
phantomjs) print_phantomjs_args $version ;;
node) print_node_args $version ;;
yarn) print_yarn_args $version ;;
postgresql) print_postgres_args $version ;;
*) exit 1;;
esac

View file

@ -3,6 +3,7 @@
set -xeo pipefail
NODE_VERSION=${1:-7.x}
YARN_VERSION=${2:-0.27.5-1}
# add official debian repos for node and yarn
curl -sS -L https://deb.nodesource.com/setup_${NODE_VERSION} | bash -
@ -10,4 +11,4 @@ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt-get update
apt-get install -y nodejs yarn
apt-get install -y nodejs yarn=$YARN_VERSION