Commit 89564f5c authored by Takuya Noguchi's avatar Takuya Noguchi

Replace Ruby 2.1/2.2/2.3 with Ruby 2.6 (and 2.7)

Signed-off-by: default avatarTakuya Noguchi <takninnovationresearch@gmail.com>
parent e37ec37f
...@@ -625,7 +625,7 @@ mounting the docker-daemon and setting `privileged = false` in the Runner's ...@@ -625,7 +625,7 @@ mounting the docker-daemon and setting `privileged = false` in the Runner's
```toml ```toml
[runners.docker] [runners.docker]
image = "ruby:2.1" image = "ruby:2.6"
privileged = false privileged = false
volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"] volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
``` ```
......
...@@ -32,14 +32,14 @@ A one-line example can be seen below: ...@@ -32,14 +32,14 @@ A one-line example can be seen below:
sudo gitlab-runner register \ sudo gitlab-runner register \
--url "https://gitlab.example.com/" \ --url "https://gitlab.example.com/" \
--registration-token "PROJECT_REGISTRATION_TOKEN" \ --registration-token "PROJECT_REGISTRATION_TOKEN" \
--description "docker-ruby-2.1" \ --description "docker-ruby:2.6" \
--executor "docker" \ --executor "docker" \
--docker-image ruby:2.1 \ --docker-image ruby:2.6 \
--docker-services postgres:latest \ --docker-services postgres:latest \
--docker-services mysql:latest --docker-services mysql:latest
``` ```
The registered runner will use the `ruby:2.1` Docker image and will run two The registered runner will use the `ruby:2.6` Docker image and will run two
services, `postgres:latest` and `mysql:latest`, both of which will be services, `postgres:latest` and `mysql:latest`, both of which will be
accessible during the build process. accessible during the build process.
...@@ -194,7 +194,7 @@ services that you want to use during build time: ...@@ -194,7 +194,7 @@ services that you want to use during build time:
```yaml ```yaml
default: default:
image: ruby:2.2 image: ruby:2.6
services: services:
- postgres:9.3 - postgres:9.3
...@@ -214,15 +214,15 @@ default: ...@@ -214,15 +214,15 @@ default:
before_script: before_script:
- bundle install - bundle install
test:2.1: test:2.6:
image: ruby:2.1 image: ruby:2.6
services: services:
- postgres:9.3 - postgres:9.3
script: script:
- bundle exec rake spec - bundle exec rake spec
test:2.2: test:2.7:
image: ruby:2.2 image: ruby:2.7
services: services:
- postgres:9.4 - postgres:9.4
script: script:
...@@ -235,7 +235,7 @@ for `image` and `services`: ...@@ -235,7 +235,7 @@ for `image` and `services`:
```yaml ```yaml
default: default:
image: image:
name: ruby:2.2 name: ruby:2.6
entrypoint: ["/bin/bash"] entrypoint: ["/bin/bash"]
services: services:
...@@ -277,7 +277,7 @@ services: ...@@ -277,7 +277,7 @@ services:
command: ["postgres"] command: ["postgres"]
image: image:
name: ruby:2.2 name: ruby:2.6
entrypoint: ["/bin/bash"] entrypoint: ["/bin/bash"]
before_script: before_script:
...@@ -773,7 +773,7 @@ time. ...@@ -773,7 +773,7 @@ time.
1. Create any service container: `mysql`, `postgresql`, `mongodb`, `redis`. 1. Create any service container: `mysql`, `postgresql`, `mongodb`, `redis`.
1. Create cache container to store all volumes as defined in `config.toml` and 1. Create cache container to store all volumes as defined in `config.toml` and
`Dockerfile` of build image (`ruby:2.1` as in above example). `Dockerfile` of build image (`ruby:2.6` as in above example).
1. Create build container and link any service container to build container. 1. Create build container and link any service container to build container.
1. Start build container and send job script to the container. 1. Start build container and send job script to the container.
1. Run job script. 1. Run job script.
...@@ -818,11 +818,11 @@ Finally, create a build container by executing the `build_script` file we ...@@ -818,11 +818,11 @@ Finally, create a build container by executing the `build_script` file we
created earlier: created earlier:
```sh ```sh
docker run --name build -i --link=service-mysql:mysql --link=service-postgres:postgres ruby:2.1 /bin/bash < build_script docker run --name build -i --link=service-mysql:mysql --link=service-postgres:postgres ruby:2.6 /bin/bash < build_script
``` ```
The above command will create a container named `build` that is spawned from The above command will create a container named `build` that is spawned from
the `ruby:2.1` image and has two services linked to it. The `build_script` is the `ruby:2.6` image and has two services linked to it. The `build_script` is
piped using STDIN to the bash interpreter which in turn executes the piped using STDIN to the bash interpreter which in turn executes the
`build_script` in the `build` container. `build_script` in the `build` container.
......
...@@ -71,12 +71,12 @@ gitlab-runner register \ ...@@ -71,12 +71,12 @@ gitlab-runner register \
--non-interactive \ --non-interactive \
--url "https://gitlab.com/" \ --url "https://gitlab.com/" \
--registration-token "PROJECT_REGISTRATION_TOKEN" \ --registration-token "PROJECT_REGISTRATION_TOKEN" \
--description "ruby-2.2" \ --description "ruby:2.6" \
--executor "docker" \ --executor "docker" \
--docker-image ruby:2.2 \ --docker-image ruby:2.6 \
--docker-postgres latest --docker-postgres latest
``` ```
With the command above, you create a Runner that uses the [ruby:2.2](https://hub.docker.com/_/ruby) image and uses a [postgres](https://hub.docker.com/_/postgres) database. With the command above, you create a Runner that uses the [ruby:2.6](https://hub.docker.com/_/ruby) image and uses a [postgres](https://hub.docker.com/_/postgres) database.
To access the PostgreSQL database, connect to `host: postgres` as user `postgres` with no password. To access the PostgreSQL database, connect to `host: postgres` as user `postgres` with no password.
...@@ -3628,7 +3628,7 @@ having their own custom `script` defined: ...@@ -3628,7 +3628,7 @@ having their own custom `script` defined:
```yaml ```yaml
.job_template: &job_definition # Hidden key that defines an anchor named 'job_definition' .job_template: &job_definition # Hidden key that defines an anchor named 'job_definition'
image: ruby:2.1 image: ruby:2.6
services: services:
- postgres - postgres
- redis - redis
...@@ -3650,13 +3650,13 @@ given hash into the current one", and `*` includes the named anchor ...@@ -3650,13 +3650,13 @@ given hash into the current one", and `*` includes the named anchor
```yaml ```yaml
.job_template: .job_template:
image: ruby:2.1 image: ruby:2.6
services: services:
- postgres - postgres
- redis - redis
test1: test1:
image: ruby:2.1 image: ruby:2.6
services: services:
- postgres - postgres
- redis - redis
...@@ -3664,7 +3664,7 @@ test1: ...@@ -3664,7 +3664,7 @@ test1:
- test1 project - test1 project
test2: test2:
image: ruby:2.1 image: ruby:2.6
services: services:
- postgres - postgres
- redis - redis
......
...@@ -382,7 +382,7 @@ end ...@@ -382,7 +382,7 @@ end
## String Freezing ## String Freezing
In recent Ruby versions calling `freeze` on a String leads to it being allocated In recent Ruby versions calling `freeze` on a String leads to it being allocated
only once and re-used. For example, on Ruby 2.3 this will only allocate the only once and re-used. For example, on Ruby 2.3 or later this will only allocate the
"foo" String once: "foo" String once:
```ruby ```ruby
......
--- ---
last_updated: 2019-06-04 last_updated: 2020-01-06
type: reference, howto type: reference, howto
--- ---
...@@ -158,7 +158,7 @@ first thing GitLab Runner will look for in your `.gitlab-ci.yml` is a ...@@ -158,7 +158,7 @@ first thing GitLab Runner will look for in your `.gitlab-ci.yml` is a
your container to run that script: your container to run that script:
```yaml ```yaml
image: ruby:2.3 image: ruby:2.7
pages: pages:
script: script:
...@@ -170,9 +170,9 @@ pages: ...@@ -170,9 +170,9 @@ pages:
``` ```
In this case, you're telling the Runner to pull this image, which In this case, you're telling the Runner to pull this image, which
contains Ruby 2.3 as part of its file system. When you don't specify contains Ruby 2.7 as part of its file system. When you don't specify
this image in your configuration, the Runner will use a default this image in your configuration, the Runner will use a default
image, which is Ruby 2.1. image, which is Ruby 2.6.
If your SSG needs [NodeJS](https://nodejs.org/) to build, you'll If your SSG needs [NodeJS](https://nodejs.org/) to build, you'll
need to specify which image you want to use, and this image should need to specify which image you want to use, and this image should
...@@ -198,7 +198,7 @@ To do that, we need to add another line to our CI, telling the Runner ...@@ -198,7 +198,7 @@ To do that, we need to add another line to our CI, telling the Runner
to only perform that _job_ called `pages` on the `master` branch `only`: to only perform that _job_ called `pages` on the `master` branch `only`:
```yaml ```yaml
image: ruby:2.3 image: ruby:2.6
pages: pages:
script: script:
...@@ -221,7 +221,7 @@ and deploy. To specify which stage your _job_ is running, ...@@ -221,7 +221,7 @@ and deploy. To specify which stage your _job_ is running,
simply add another line to your CI: simply add another line to your CI:
```yaml ```yaml
image: ruby:2.3 image: ruby:2.6
pages: pages:
stage: deploy stage: deploy
...@@ -244,7 +244,7 @@ let's add another task (_job_) to our CI, telling it to ...@@ -244,7 +244,7 @@ let's add another task (_job_) to our CI, telling it to
test every push to other branches, `except` the `master` branch: test every push to other branches, `except` the `master` branch:
```yaml ```yaml
image: ruby:2.3 image: ruby:2.6
pages: pages:
stage: deploy stage: deploy
...@@ -294,7 +294,7 @@ every single _job_. In our example, notice that we run ...@@ -294,7 +294,7 @@ every single _job_. In our example, notice that we run
We don't need to repeat it: We don't need to repeat it:
```yaml ```yaml
image: ruby:2.3 image: ruby:2.6
before_script: before_script:
- bundle install - bundle install
...@@ -329,7 +329,7 @@ cache Jekyll dependencies in a `vendor` directory ...@@ -329,7 +329,7 @@ cache Jekyll dependencies in a `vendor` directory
when we run `bundle install`: when we run `bundle install`:
```yaml ```yaml
image: ruby:2.3 image: ruby:2.6
cache: cache:
paths: paths:
......
--- ---
type: reference type: reference
last_updated: 2018-06-04 last_updated: 2020-01-06
--- ---
# Exploring GitLab Pages # Exploring GitLab Pages
...@@ -156,7 +156,7 @@ Below is a copy of `.gitlab-ci.yml` where the most significant line is the last ...@@ -156,7 +156,7 @@ Below is a copy of `.gitlab-ci.yml` where the most significant line is the last
one, specifying to execute everything in the `pages` branch: one, specifying to execute everything in the `pages` branch:
``` ```
image: ruby:2.1 image: ruby:2.6
pages: pages:
script: script:
......
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