Skip to content
This repository was archived by the owner on Feb 24, 2022. It is now read-only.
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
16 changes: 16 additions & 0 deletions .kub/mystuff/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ spec:
- name: back
containerPort: 9000
protocol: TCP
readinessProbe:
httpGet:
path: /health
port: 9000
initialDelaySeconds: 40
timeoutSeconds: 2
periodSeconds: 3
failureThreshold: 2
livenessProbe:
httpGet:
path: /health
port: 9000
initialDelaySeconds: 100
timeoutSeconds: 2
periodSeconds: 8
failureThreshold: 1
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected void configure(HttpSecurity httpSecurity) throws Exception {
.authorizeRequests()
//.antMatchers(HttpMethod.OPTIONS, "/**").permitAll()

.antMatchers("/rest/token/new", "/rest/user/register").permitAll()
.antMatchers("/rest/token/new", "/rest/user/register", "/health").permitAll()
.anyRequest().authenticated();

// Custom JWT based security filter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;


@WithMockCustomUser
public class SpringActuatorTest extends AbstractControllerTest {


@Test
public void whenGetHealth_shouldReturnUP() throws Exception {
mockMvc.perform(get("/health").contentType(APPLICATION_JSON))
Expand Down
8 changes: 4 additions & 4 deletions pipeline/jenkins/validate.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pipeline {
label 'mystuff-validate-maven'
containerTemplate {
name 'maven'
image 'maven:3.5.4-jdk-11-slim'
image 'webtree/build-images:maven-jdk-11'
ttyEnabled true
command 'cat'
}
Expand Down Expand Up @@ -116,7 +116,6 @@ pipeline {
dir('web') {
script {
withDockerRegistry(credentialsId: 'docker-hub') {

def image = docker.build("webtree/mystuff:${webTag}")
image.push(webTag)
}
Expand Down Expand Up @@ -237,8 +236,9 @@ private void deployDevEnv(buildVersion, webTag, backTag, projectName, tier) {
def deployName = "${projectName}-${tier}-${buildVersion}"
def webUrl = "${projectName}-${buildVersion}.dev.webtree.org"
def backUrl = "back.${deployName}.webtree.org"
def pass = sh(script:"head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo ''", returnStdout: true).trim()
sh "helm delete ${deployName} --purge || true"
sh "helm install --wait --name=${deployName} --namespace=webtree-${tier} --set nameOverride=${deployName},ingress.web.host=${webUrl},ingress.back.host=${backUrl},images.web.tag=${webTag},images.back.tag=${backTag} -f values.${tier}.yaml ."
sh "helm install --wait --name=${deployName} --namespace=webtree-${tier} --set nameOverride=${deployName},ingress.web.host=${webUrl},ingress.back.host=${backUrl},images.web.tag=${webTag},images.back.tag=${backTag},neo4j.neo4jPassword=${pass} -f values.${tier}.yaml ."
def message = "Test system provisioned on url https://${webUrl}. Backend: https://${backUrl}"
sendPrComment("mystuff", env.CHANGE_ID, message)

Expand All @@ -257,4 +257,4 @@ private void sendPrComment(repo, issueId, message) {
url: "https://api.github.com/repos/Web-tree/${repo}/issues/${issueId}/comments",
authentication: 'github-repo-token',
validResponseCodes: '201')
}
}