Skip to content

Commit

Permalink
Update Semaphore Config
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredmoody committed Sep 13, 2022
1 parent 565da5f commit 31bc543
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions lib/getOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ const getBaseOptions = cb => {

if (process.env.SEMAPHORE) {
options.service_name = 'semaphore';
options.service_job_id = process.env.SEMAPHORE_BUILD_NUMBER;
git_commit = process.env.REVISION;
git_branch = process.env.BRANCH_NAME;
options.service_job_id = process.env.SEMAPHORE_WORKFLOW_ID;
options.service_pull_request = process.env.SEMAPHORE_GIT_PR_NUMBER;
git_commit = process.env.SEMAPHORE_GIT_SHA;
git_branch = process.env.SEMAPHORE_GIT_WORKING_BRANCH;
}

if (process.env.TF_BUILD) {
Expand Down
8 changes: 5 additions & 3 deletions test/getOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,10 @@ const testBuildkite = (sut, done) => {

const testSemaphore = (sut, done) => {
process.env.SEMAPHORE = true;
process.env.SEMAPHORE_BUILD_NUMBER = '1234';
process.env.REVISION = 'e3e3e3e3e3e3e3e3e';
process.env.BRANCH_NAME = 'master';
process.env.SEMAPHORE_WORKFLOW_ID = '1234';
process.env.SEMAPHORE_GIT_SHA = 'e3e3e3e3e3e3e3e3e';
process.env.SEMAPHORE_GIT_WORKING_BRANCH = 'master';
process.env SEMAPHORE_GIT_PR_NUMBER = '456';

const git = {
head: {
Expand All @@ -678,6 +679,7 @@ const testSemaphore = (sut, done) => {
should.not.exist(err);
options.service_name.should.equal('semaphore');
options.service_job_id.should.equal('1234');
options.service_pull_request.should.equal('456');
options.git.should.eql(git);
done();
});
Expand Down

0 comments on commit 31bc543

Please sign in to comment.