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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +17 -0
  3. data/Dockerfile +7 -0
  4. data/README.md +40 -3
  5. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8f7e5ab344ba700d815ccb45c8517034ef447a54662085cb471a038722b3654
4
- data.tar.gz: 77c2ecb3172f22400ca421aed782f1e432fe0f0e96edad34da75f7eb16ae3b3b
3
+ metadata.gz: b9e0ba6497503d24cc631e5a561879a5b8fddd9b0b98243b4b92d2f05f5add90
4
+ data.tar.gz: ac56fb2b77daf823e235cf7c06e6ca8ad29d585f261e83a90506efe7a3f30fd2
5
5
  SHA512:
6
- metadata.gz: fc6e772626ccfcb72805c0c0c7f6fbcc8aa5f9e434b2843978df1953fc8b39a03293e272e60f1244d2ce893f035f48024bf613887bcedbcbdc63d5b49f1384b3
7
- data.tar.gz: dfd7b5c4fde16aaf750c9b5964f9c845b5600acbe82aea2a65733d8bc3a3c48b52284c0a9e1208361aa8fcfe649536e58eae05d24e21fc88a87adee2da3e2219
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
@@ -0,0 +1,7 @@
1
+ FROM ruby:2.7.5-alpine3.15
2
+
3
+ RUN gem install gfsm
4
+
5
+ COPY ./gfsmrc.yml ./gfsmrc.yml
6
+
7
+ ENTRYPOINT [""]
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
- There are two ways to run this tool locally at the moment:
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
- ./bin/gfsm [args]
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.2.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-07-04 00:00:00.000000000 Z
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