forked from ember-redux/ember-redux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from gynzy/SRE-382
feat: add master merge support
- Loading branch information
Showing
28 changed files
with
1,551 additions
and
682 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,16 @@ | ||
local util = import './.github/jsonnet/index.jsonnet'; | ||
local image = 'eu.gcr.io/unicorn-985/docker-images_node14-with-libnss:deploy-5893c6fca68ea35a0a51e855d5a3cb7082ef39fa'; | ||
|
||
util.pipeline( | ||
local testJob = util.ghJob( | ||
'test-pr', | ||
[ | ||
util.ghJob( | ||
'test-pr', | ||
image=image, | ||
useCredentials=true, | ||
steps=[ | ||
util.checkoutAndYarn(ref='${{ github.event.pull_request.head.sha }}', fullClone=false), | ||
util.action('setup chrome', 'browser-actions/setup-chrome@latest'), | ||
util.step('test', './node_modules/.bin/ember test'), | ||
util.yarnPublish(isPr=true), | ||
], | ||
runsOn=['ubuntu-latest'], // it's public fork. don't use private runners for public fork | ||
), | ||
image=image, | ||
useCredentials=true, | ||
steps=[ | ||
util.checkoutAndYarn(ref='${{ github.event.pull_request.head.sha }}', fullClone=false), | ||
util.action('setup chrome', 'browser-actions/setup-chrome@latest'), | ||
util.step('test', './node_modules/.bin/ember test'), | ||
], | ||
) + | ||
util.pipeline( | ||
'publish-tag', | ||
[ | ||
util.ghJob( | ||
'publish', | ||
image=image, | ||
useCredentials=true, | ||
steps=[ | ||
util.checkoutAndYarn(ref='${{ github.sha }}', fullClone=false), | ||
util.yarnPublish(isPr=false), | ||
], | ||
runsOn=['ubuntu-latest'], // it's public fork. don't use private runners for public fork | ||
), | ||
], | ||
event={ | ||
push: { tags: ['*'] }, | ||
}, | ||
) | ||
runsOn=['ubuntu-latest'], // it's public fork. don't use private runners for public fork | ||
); | ||
|
||
util.workflowJavascriptPackage(testJob=testJob) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
497456f307c7f9ef1d9ac1660b951b1cf8a6e024 | ||
9f0090f332fe3306ec145c60d2e129628aee2f9c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
/* | ||
@param {string[]} repositories - The repositories to publish to | ||
@param {boolean} isPublicFork - Whether the repository is a public fork | ||
@param {boolean} checkVersionBump - Whether to assert if the version was bumped (recommended) | ||
@param {ghJob} testJob - a job to be ran during PR to assert tests. can be an array of jobs | ||
*/ | ||
workflowJavascriptPackage(repositories=['gynzy'], isPublicFork=true, checkVersionBump=true, testJob=null):: | ||
local runsOn = (if isPublicFork then 'ubuntu-latest' else null); | ||
|
||
$.pipeline( | ||
'misc', | ||
[$.verifyJsonnet(fetch_upstream=false, runsOn=runsOn)], | ||
) + | ||
$.pipeline( | ||
'publish-prod', | ||
[ | ||
$.yarnPublishJob(repositories, runsOn=runsOn), | ||
], | ||
event={ push: { branches: ['${{ github.event.pull_request.base.ref }}'] } }, | ||
) + | ||
$.pipeline( | ||
'pr', | ||
[ | ||
$.yarnPublishPreviewJob(repositories=repositories, runsOn=runsOn, checkVersionBump=checkVersionBump), | ||
] + | ||
(if testJob != null then | ||
[testJob] | ||
else []) | ||
), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,106 @@ | ||
{ | ||
database_servers: { | ||
test: { | ||
server: 'test-ams', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
}, | ||
'test-ams-8': { | ||
server: 'test-ams-8', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
}, | ||
'eu-w4-unicorn-production': { | ||
server: 'eu-w4-unicorn-production', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
}, | ||
'eu-w4-responses-production' : { | ||
server: 'eu-w4-responses-production', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
}, | ||
'eu-w4-metrics-production' : { | ||
server: 'eu-w4-metrics-production', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
}, | ||
'gynzy-test' : { | ||
server: 'gynzy-test', | ||
region: 'europe-west4', | ||
project: 'gynzy-1090', | ||
}, | ||
'gynzy-production' : { | ||
server: 'gynzy-production', | ||
region: 'europe-west4', | ||
project: 'gynzy-1090', | ||
}, | ||
'accounts-production': { | ||
server: 'eu-w4-accounts-production', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
}, | ||
'eu-w4-licenses-v8' : { | ||
server: 'eu-w4-licenses-v8', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
}, | ||
'eu-w4-curriculum-v8': { | ||
server: 'eu-w4-curriculum-v8', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
} | ||
test: { | ||
type: 'mysql', | ||
server: 'test-ams', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
lifecycle: 'test', | ||
}, | ||
'test-ams-8': { | ||
type: 'mysql', | ||
server: 'test-ams-8', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
lifecycle: 'test', | ||
}, | ||
'eu-w4-unicorn-production': { | ||
type: 'mysql', | ||
server: 'eu-w4-unicorn-production', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
}, | ||
'eu-w4-responses-production': { | ||
type: 'mysql', | ||
server: 'eu-w4-responses-production', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
}, | ||
'eu-w4-metrics-production': { | ||
type: 'mysql', | ||
server: 'eu-w4-metrics-production', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
}, | ||
'gynzy-test': { | ||
type: 'mysql', | ||
server: 'gynzy-test', | ||
region: 'europe-west4', | ||
project: 'gynzy-1090', | ||
lifecycle: 'test', | ||
}, | ||
'gynzy-production': { | ||
type: 'mysql', | ||
server: 'gynzy-production', | ||
region: 'europe-west4', | ||
project: 'gynzy-1090', | ||
}, | ||
'accounts-production': { | ||
type: 'mysql', | ||
server: 'eu-w4-accounts-production', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
}, | ||
'eu-w4-licenses-v8': { | ||
type: 'mysql', | ||
server: 'eu-w4-licenses-v8', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
}, | ||
'eu-w4-curriculum-v8': { | ||
type: 'mysql', | ||
server: 'eu-w4-curriculum-v8', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
}, | ||
'eu-w4-enrollments-v8': { | ||
type: 'mysql', | ||
server: 'eu-w4-enrollments-v8', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
}, | ||
'eu-w4-board-v8': { | ||
type: 'mysql', | ||
server: 'eu-w4-board-v8', | ||
region: 'europe-west4', | ||
project: 'unicorn-985', | ||
}, | ||
|
||
}, | ||
|
||
copyDatabase(mysqlActionOptions):: | ||
assert std.length(std.findSubstr('_pr_', mysqlActionOptions.database_name_target)) > 0; // target db gets deleted. must contain _pr_ | ||
assert std.length(std.findSubstr('_pr_', mysqlActionOptions.database_name_target)) > 0; // target db gets deleted. must contain _pr_ | ||
|
||
// overwrite and set task to clone | ||
// delete database by setting it to null and calling prune afterwards | ||
local pluginOptions = std.prune(mysqlActionOptions + { task: 'clone', database: null }); | ||
local pluginOptions = std.prune(mysqlActionOptions { task: 'clone', database: null }); | ||
|
||
$.action('copy-database', $.mysql_action_image, | ||
$.action( | ||
'copy-database', | ||
$.mysql_action_image, | ||
with=pluginOptions | ||
), | ||
|
||
deleteDatabase(mysqlActionOptions):: | ||
assert std.length(std.findSubstr('_pr_', mysqlActionOptions.database_name_target)) > 0; // this fn deletes the database. destination db must contain _pr_ | ||
assert std.length(std.findSubstr('_pr_', mysqlActionOptions.database_name_target)) > 0; // this fn deletes the database. destination db must contain _pr_ | ||
|
||
// overwrite and set task to clone | ||
// delete database by setting it to null and calling prune afterwards | ||
local pluginOptions = std.prune(mysqlActionOptions + { task: 'remove', database: null }); | ||
local pluginOptions = std.prune(mysqlActionOptions { task: 'remove', database: null }); | ||
|
||
$.action('delete-database', $.mysql_action_image, | ||
$.action( | ||
'delete-database', | ||
$.mysql_action_image, | ||
with=pluginOptions | ||
), | ||
} | ||
} |
Oops, something went wrong.