|
1 |
| -# semantic-release-docker |
2 |
| - |
3 |
| -[](https://www.npmjs.com/package/felixfbecker/semantic-release-docker) |
4 |
| -[](https://travis-ci.org/felixfbecker/semantic-release-docker) |
5 |
| -[](https://www.npmjs.com/package/semantic-release-docker) |
6 |
| -[](https://david-dm.org/felixfbecker/semantic-release-docker) |
7 |
| -[](https://david-dm.org/felixfbecker/semantic-release-docker?type=peer) |
8 |
| -[](https://greenkeeper.io/) |
| 1 | +# semantic-release-gitlab-registry |
| 2 | + |
| 3 | +[](https://www.npmjs.com/package/lgaticaq/semantic-release-gitlab-registry) |
| 4 | +[](https://travis-ci.org/lgaticaq/semantic-release-gitlab-registry) |
| 5 | +[](https://www.npmjs.com/package/semantic-release-gitlab-registry) |
| 6 | +[](https://david-dm.org/lgaticaq/semantic-release-gitlab-registry) |
| 7 | +[](https://david-dm.org/lgaticaq/semantic-release-gitlab-registry?type=peer) |
| 8 | +[](https://greenkeeper.io/) |
9 | 9 | [](https://github.com/prettier/prettier)
|
10 | 10 | [](https://github.com/semantic-release/semantic-release)
|
11 |
| -[](https://github.com/felixfbecker/semantic-release-docker/blob/master/LICENSE) |
| 11 | +[](https://github.com/lgaticaq/semantic-release-gitlab-registry/blob/master/LICENSE) |
12 | 12 |
|
13 |
| -Set of [semantic-release](https://github.com/semantic-release/semantic-release) plugins for publishing a docker image to |
14 |
| -[Docker Hub](https://hub.docker.com/). |
| 13 | +Set of [semantic-release](https://github.com/semantic-release/semantic-release) plugins for publishing a docker image to [GitLab Container Registry](https://docs.gitlab.com/ce/user/project/container_registry.html). |
15 | 14 |
|
16 | 15 | ```json
|
17 | 16 | {
|
18 | 17 | "release": {
|
19 |
| - "verifyConditions": "semantic-release-docker", |
| 18 | + "verifyConditions": "semantic-release-gitlab-registry", |
20 | 19 | "publish": {
|
21 |
| - "path": "semantic-release-docker", |
| 20 | + "path": "semantic-release-gitlab-registry", |
22 | 21 | "name": "username/imagename"
|
23 | 22 | }
|
24 | 23 | }
|
25 | 24 | }
|
26 | 25 | ```
|
27 | 26 |
|
28 |
| -## Configuration |
29 |
| - |
30 |
| -Your credentials have to be configured with the environment variables `DOCKER_USERNAME` and `DOCKER_PASSWORD`. |
31 |
| - |
32 |
| -In addition, you need to specify the name of the image as the `name` setting. |
33 |
| - |
34 | 27 | ## Plugins
|
35 | 28 |
|
36 | 29 | ### `verifyConditions`
|
37 | 30 |
|
38 |
| -Verify that all needed configuration is present and login to the Docker registry. |
| 31 | +Verify that all needed configuration is present and login to the GitLab Container Registry. |
39 | 32 |
|
40 | 33 | ### `publish`
|
41 | 34 |
|
42 |
| -Tag the image specified by `name` with the new version, push it to Docker Hub and update the `latest` tag. |
| 35 | +Tag the image with the new version, push it to GitLab Container Registry and update the `latest` tag. |
43 | 36 |
|
44 |
| -## Example .travis.yml |
| 37 | +## Example .gitlab-ci.yml |
45 | 38 |
|
46 | 39 | ```yml
|
47 |
| -jobs: |
48 |
| - include: |
49 |
| - - stage: release |
50 |
| - language: node_js |
51 |
| - node_js: '8' |
52 |
| - services: |
53 |
| - - docker |
54 |
| - script: |
55 |
| - - docker build -t username/imagename . |
56 |
| - - npm run semantic-release |
57 |
| - |
58 | 40 | stages:
|
59 | 41 | - test
|
60 |
| - - name: release |
61 |
| - if: branch = master AND type = push AND fork = false |
62 |
| - |
63 |
| -branches: |
64 |
| - except: |
65 |
| - - /^v\d+\.\d+\.\d+$/ |
| 42 | + - release |
| 43 | + |
| 44 | +test: |
| 45 | + image: node:alpine |
| 46 | + stage: test |
| 47 | + before_script: |
| 48 | + - npm i |
| 49 | + script: |
| 50 | + - npm t |
| 51 | + |
| 52 | +release: |
| 53 | + image: node:alpine |
| 54 | + stage: release |
| 55 | + before_script: |
| 56 | + - npm i |
| 57 | + - docker build -t $CI_REGISTRY_IMAGE . |
| 58 | + script: |
| 59 | + - npx semantic-release |
| 60 | + only: |
| 61 | + - master |
66 | 62 | ```
|
0 commit comments