Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/scripts/build-image/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ async function main() {
tags.forEach((tag) => console.log(tag));

const buildArgs = {
...(type === "web" ? { COMMIT_SHA: gitSha } : {}),
...(environment === "staging" ?
{
VITE_STAGING: true,
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ server:

app:
commit:
sha: "@commit.sha@"
sha: "${VERSION:@commit.sha@}"

jedis:
url: ${REDIS_URL}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.patinanetwork.codebloom.api;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import org.junit.jupiter.api.Test;
import org.patinanetwork.codebloom.common.dto.ApiResponder;
import org.patinanetwork.codebloom.utilities.ServerMetadataObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.mock.web.MockHttpServletRequest;

@SpringBootTest(classes = ApiController.class, webEnvironment = WebEnvironment.NONE, properties = "VERSION=abc1234")
public class ApiControllerVersionTest {

@Autowired
private ApiController apiController;

@Test
void testApiVersionUsesRuntimeVersion() {
ApiResponder<ServerMetadataObject> apiResponder =
apiController.apiIndex(new MockHttpServletRequest()).getBody();

assertNotNull(apiResponder, "Expected an API response");
assertNotNull(apiResponder.getPayload(), "Expected server metadata");
assertEquals(
"abc1234", apiResponder.getPayload().getVersion(), "Expected the runtime VERSION in server metadata");
}
}
Loading