Skip to content

Commit

Permalink
chore: update jsonnet
Browse files Browse the repository at this point in the history
  • Loading branch information
genisd committed Dec 11, 2024
1 parent b481ab6 commit b586eed
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/jsonnet/GIT_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
84ec8f29f0c97ca93ebcb74c1e338d3cb6c03302
7be999c2b8bc5c5713f9bc0203caac0ace3983a7
6 changes: 0 additions & 6 deletions .github/jsonnet/databases.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ local images = import 'images.jsonnet';
region: 'europe-west4',
project: 'unicorn-985',
},
'eu-w4-responses-production': {
type: 'mysql',
server: 'eu-w4-responses-production',
region: 'europe-west4',
project: 'unicorn-985',
},
'gynzy-test': {
type: 'mysql',
server: 'gynzy-test',
Expand Down
2 changes: 1 addition & 1 deletion .github/jsonnet/deployment.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ local notifications = import 'notifications.jsonnet';
if branch.notifyOnDeploy then
[
notifications.sendSlackMessage(
message='Deploy to ' + std.join(' and ', branch.deployments) + ' of <https://github.com/${{ github.action_repository }}/pulls/${{ github.event.number }}|*PR ${{ github.event.number }}*> started!\nTitle: ${{ github.event.pull_request.title }}\nBranch: ${{ github.head_ref }}',
message='Deploy to ' + std.join(' and ', branch.deployments) + ' of <https://github.com/${{ github.repository }}/pull/${{ github.event.number }}|*PR ${{ github.event.number }}*> started!\nTitle: ${{ github.event.pull_request.title }}\nBranch: ${{ github.head_ref }}',
ifClause=ifClause,
),
]
Expand Down
22 changes: 14 additions & 8 deletions .github/jsonnet/misc.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ local base = import 'base.jsonnet';
local images = import 'images.jsonnet';

{
checkout(ifClause=null, fullClone=false, ref=null)::
local with = (if fullClone then { 'fetch-depth': 0 } else {}) + (if ref != null then { ref: ref } else {});
checkout(ifClause=null, fullClone=false, ref=null, sshKey=true)::
local with = (if fullClone then { 'fetch-depth': 0 } else {}) + (if ref != null then { ref: ref } else {}) +
(if sshKey then { 'ssh-key': '${{ secrets.VIRKO_GITHUB_SSH_KEY }}' } else {});
base.action(
'Check out repository code',
'actions/checkout@v3',
'actions/checkout@v4',
with=with,
ifClause=ifClause
) +
Expand Down Expand Up @@ -200,9 +201,14 @@ local images = import 'images.jsonnet';
function(app) std.flatMap(
function(env)
if std.isObject(app[env]) then
std.map(function(linkName) '[' + app.name + ' ' + env + ' ' + linkName + ' preview](' + app[env][linkName] + ')', std.objectFields(app[env]))
std.map(
function(linkName)
'[' + std.strReplace(std.strReplace(app.name + ' ' + env + ' ' + linkName, '(', ''), ')', '') + ' preview]' +
'(' + app[env][linkName] + ')',
std.objectFields(app[env])
)
else
['[' + app.name + ' ' + env + ' preview](' + app[env] + ')'],
['[' + std.strReplace(std.strReplace(app.name + ' ' + env, '(', ''), ')', '') + ' preview](' + app[env] + ')'],

app.linkToLinear,
),
Expand Down Expand Up @@ -374,12 +380,12 @@ local images = import 'images.jsonnet';
NODESELECTOR_TYPE: cluster.jobNodeSelectorType,
} + environment,
),

// Auto approve PRs made by specific users. Usefull for renovate PRs.
//
// Parameters:
// users: a list of users to auto approve PRs for. Defaults to gynzy-virko.
autoApprovePRs(users = ['gynzy-virko'])::
autoApprovePRs(users=['gynzy-virko'])::
base.pipeline(
'auto-approve-prs',
[
Expand All @@ -392,7 +398,7 @@ local images = import 'images.jsonnet';
),
],
useCredentials=false,
ifClause='${{ ' + std.join(' || ', std.map(function(user) 'github.actor == \'' + user + '\'', users)) + ' }}',
ifClause='${{ ' + std.join(' || ', std.map(function(user) "github.actor == '" + user + "'", users)) + ' }}',
),
],
permissions={
Expand Down
4 changes: 2 additions & 2 deletions .github/jsonnet/pnpm.jsonnet
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
local base = import 'base.jsonnet';

{
install(args=[], with={})::
install(args=[], with={}, version='9.5.0')::
base.action(
'Install application code',
'pnpm/action-setup@v4',
with={
version: '9.5.0',
version: version,
run_install: |||
- args: %(args)s
||| % { args: args },
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
"runs-on": "ubuntu-latest"
"steps":
- "name": "Check out repository code"
"uses": "actions/checkout@v3"
"uses": "actions/checkout@v4"
"with":
"ref": "${{ github.event.pull_request.head.sha }}"
"ssh-key": "${{ secrets.VIRKO_GITHUB_SSH_KEY }}"
- "name": "git safe directory"
"run": "command -v git && git config --global --add safe.directory '*' || true"
- "name": "remove-workflows"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
- "ubuntu-latest"
"steps":
- "name": "Check out repository code"
"uses": "actions/checkout@v3"
"uses": "actions/checkout@v4"
"with":
"ref": "${{ github.event.pull_request.head.sha }}"
"ssh-key": "${{ secrets.VIRKO_GITHUB_SSH_KEY }}"
- "name": "git safe directory"
"run": "command -v git && git config --global --add safe.directory '*' || true"
- "env":
Expand Down Expand Up @@ -40,9 +41,10 @@
"runs-on": "ubuntu-latest"
"steps":
- "name": "Check out repository code"
"uses": "actions/checkout@v3"
"uses": "actions/checkout@v4"
"with":
"ref": "${{ github.event.pull_request.head.sha }}"
"ssh-key": "${{ secrets.VIRKO_GITHUB_SSH_KEY }}"
- "name": "git safe directory"
"run": "command -v git && git config --global --add safe.directory '*' || true"
- "env":
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publish-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
"runs-on": "ubuntu-latest"
"steps":
- "name": "Check out repository code"
"uses": "actions/checkout@v3"
"uses": "actions/checkout@v4"
"with":
"ref": "${{ github.sha }}"
"ssh-key": "${{ secrets.VIRKO_GITHUB_SSH_KEY }}"
- "name": "git safe directory"
"run": "command -v git && git config --global --add safe.directory '*' || true"
- "env":
Expand Down

0 comments on commit b586eed

Please sign in to comment.