gfsm 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +17 -0
- data/Dockerfile +7 -0
- data/README.md +40 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9e0ba6497503d24cc631e5a561879a5b8fddd9b0b98243b4b92d2f05f5add90
|
4
|
+
data.tar.gz: ac56fb2b77daf823e235cf7c06e6ca8ad29d585f261e83a90506efe7a3f30fd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99373328bcc6e18fa2bd4c588a98fca5ff359fa83c2f1281049236a23f5f8631aafb9676ab813461dd2a6b87a89a83a3b595cc81db9d7266f141d412ca0c8f61
|
7
|
+
data.tar.gz: 1928c819f0a3bc20d324cacfb038506ed6eaf0cacb425070bcd09c4f85ea65bde18374cd4029aa2808552b2e6a71f4e46169811a3404e034177f9c0c32a2ab66
|
data/.gitlab-ci.yml
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
stages:
|
2
2
|
- version
|
3
3
|
- deploy
|
4
|
+
- docker
|
4
5
|
- release
|
5
6
|
|
6
7
|
workflow:
|
@@ -56,6 +57,20 @@ Publish gem:
|
|
56
57
|
when: never
|
57
58
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
58
59
|
|
60
|
+
Upload docker image:
|
61
|
+
stage: docker
|
62
|
+
image: docker:20.10.16
|
63
|
+
services:
|
64
|
+
- docker:20.10.16-dind
|
65
|
+
script:
|
66
|
+
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
67
|
+
- docker build -t $CI_REGISTRY/zille_marco/gitlab-flavored-semantic-versioning:latest -t $CI_REGISTRY/zille_marco/gitlab-flavored-semantic-versioning:v$RELEASE_VERSION .
|
68
|
+
- docker push --all-tags $CI_REGISTRY/zille_marco/gitlab-flavored-semantic-versioning
|
69
|
+
rules:
|
70
|
+
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
|
71
|
+
when: never
|
72
|
+
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
73
|
+
|
59
74
|
Create release:
|
60
75
|
stage: release
|
61
76
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
@@ -67,6 +82,8 @@ Create release:
|
|
67
82
|
artifacts: true
|
68
83
|
- job: "Publish gem"
|
69
84
|
artifacts: false
|
85
|
+
- job: "Upload docker image"
|
86
|
+
artifacts: false
|
70
87
|
rules:
|
71
88
|
- if: '$GEM_HOST_API_KEY == null'
|
72
89
|
when: never
|
data/Dockerfile
ADDED
data/README.md
CHANGED
@@ -56,8 +56,45 @@ At the moment there's no built-in testing platform, but I'm planning to use `rsp
|
|
56
56
|
|
57
57
|
### Using
|
58
58
|
|
59
|
-
|
59
|
+
This project is available as a Ruby gem, so to be able to use it is enough to run
|
60
60
|
|
61
61
|
```shell
|
62
|
-
|
63
|
-
```
|
62
|
+
gem install gfsm
|
63
|
+
```
|
64
|
+
|
65
|
+
Once that command completes, the gem will be available and you can invoke it from the command line with
|
66
|
+
|
67
|
+
```shell
|
68
|
+
gfsm help
|
69
|
+
```
|
70
|
+
|
71
|
+
The main way this project can be used though, is inside a CI pipeline where you can invoke it to bump the version and/or update the changelog.
|
72
|
+
|
73
|
+
In order to use is inside a CI job, the job itself could look something like this:
|
74
|
+
|
75
|
+
```yaml
|
76
|
+
stages:
|
77
|
+
- version
|
78
|
+
|
79
|
+
update-version:
|
80
|
+
stage: version
|
81
|
+
image: ruby:2.7.5
|
82
|
+
before_script:
|
83
|
+
- gem install gfsm
|
84
|
+
script:
|
85
|
+
- gfsm version bump --force > .version
|
86
|
+
- gfsm changelog --force --output-file CHANGELOG.md
|
87
|
+
- echo "RELEASE_VERSION=$(<.version)" >> variables.env
|
88
|
+
artifacts:
|
89
|
+
reports:
|
90
|
+
dotenv: variables.env
|
91
|
+
paths:
|
92
|
+
- .version
|
93
|
+
- CHANGELOG.md
|
94
|
+
```
|
95
|
+
|
96
|
+
With this, subsequent jobs that depend on the `update-version` job will:
|
97
|
+
- be able to get the new version form the `RELEASE_VERSION` environment variable
|
98
|
+
- read the `CHANGELOG.md` file to get an updated changelog file
|
99
|
+
|
100
|
+
To have a working example of the things described above you can have a look at the `.gitlab-ci.yml` of this project, which implements this exact concept.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gfsm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zille Marco
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yaml
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- ".gitlab-ci.yml"
|
66
66
|
- ".tool-versions"
|
67
67
|
- ".vscode/launch.json"
|
68
|
+
- Dockerfile
|
68
69
|
- Gemfile
|
69
70
|
- Gemfile.lock
|
70
71
|
- README.md
|