Skip to content

Commit

Permalink
Chore: setup semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
pustovitDmytro committed Jul 10, 2022
1 parent b3b4176 commit b857542
Show file tree
Hide file tree
Showing 9 changed files with 286 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ jobs:
condition:
not: << pipeline.parameters.skip-deploy >>
steps:
- setup_remote_docker:
version: 20.10.14
- restore_cache:
<<: *cache-defaults
- run:
Expand Down
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
!package-lock.json
!LICENSE.md
!CHANGELOG.md

!templates/*
8 changes: 4 additions & 4 deletions .nycrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
],
"report-dir": "./reports/coverage",
"temp-dir": "./reports/coverage",
"lines": 95,
"statements": 90,
"functions": 90,
"branches": 85,
"lines": 87,
"statements": 86,
"functions": 78,
"branches": 63,
"check-coverage": true
}
5 changes: 3 additions & 2 deletions .package-tester.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"copy": [
[ "tests/init.js", "tests-init.js" ],
[ "tests/test.env", ".env" ],
[ ".env.defaults", ".env.defaults" ]
[ ".env.defaults", ".env.defaults" ],
[ "templates", "templates" ]
],
"copyDefaultFiles": true,
"modules": [ "cls-hooked", "fs-extra", "uuid", "winston", "winston-array-transport" ]
"modules": [ "cls-hooked", "fs-extra", "uuid", "winston", "winston-array-transport", "supertest" ]
}
59 changes: 56 additions & 3 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,66 @@
}
],
[
"@semantic-release/npm",{
"tarballDir": "./"
"@google/semantic-release-replace-plugin",
{
"replacements": [
{
"files": ["package.json"],
"from": "\"version\":\\s*\".*\"",
"to": "\"version\": \"${nextRelease.version}\""
},
{
"files": ["docker/Admin.dockerfile", "docker/Worker.dockerfile"],
"from": "FROM pustovitdmytro/ianus-base:.*",
"to": "FROM pustovitdmytro/ianus-base:${nextRelease.version}"
}
]
}
],
[
"@codedependant/semantic-release-docker", {
"dockerTags": [ "latest", "{version}", "{major}", "{major}.{minor}" ],
"dockerImage": "ianus-base",
"dockerFile": "docker/Base.dockerfile",
"dockerProject": "pustovitdmytro",
"dockerArgs": {
"BUILD_DATE": "{now}",
"BUILD_VERSION": "{next.version}"
}
}
],
[
"@semantic-release/exec", {
"prepareCmd": "./bin/retag-base.sh ${nextRelease.version}"
}
],
[
"@codedependant/semantic-release-docker", {
"dockerTags": [ "latest", "{version}", "{major}", "{major}.{minor}" ],
"dockerImage": "ianus-admin",
"dockerFile": "docker/Admin.dockerfile",
"dockerProject": "pustovitdmytro",
"dockerArgs": {
"BUILD_DATE": "{now}",
"BUILD_VERSION": "{next.version}"
}
}
],
[
"@codedependant/semantic-release-docker", {
"dockerTags": [ "latest", "{version}", "{major}", "{major}.{minor}" ],
"dockerImage": "ianus-worker",
"dockerFile": "docker/Worker.dockerfile",
"dockerProject": "pustovitdmytro",
"dockerArgs": {
"BUILD_DATE": "{now}",
"BUILD_VERSION": "{next.version}"
}
}
],
[
"@semantic-release/git", {
"assets": ["README.md", "CHANGELOG.md", "package.json"],
"assets": ["README.md", "CHANGELOG.md", "package.json", "docker/*.dockerfile"],
"message": "Chore: (release) add version ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
Expand Down
6 changes: 6 additions & 0 deletions bin/retag-base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

VERSION=$1

IMAGE_ID=$(docker images --filter=reference=pustovitdmytro/ianus-base --format "{{.ID}}")
docker tag $IMAGE_ID pustovitdmytro/ianus-base:$VERSION
Loading

0 comments on commit b857542

Please sign in to comment.