Added test environment
This commit is contained in:
45
Jenkinsfile
vendored
45
Jenkinsfile
vendored
@@ -32,7 +32,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Push the Docker Image to DockerHUb') {
|
stage('Push the Docker Image to DockerHub') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
withCredentials([string(credentialsId: 'c7783e4f-2f79-482f-885f-dfb39f8c02d3', variable: 'docker_hub')]) {
|
withCredentials([string(credentialsId: 'c7783e4f-2f79-482f-885f-dfb39f8c02d3', variable: 'docker_hub')]) {
|
||||||
@@ -48,13 +48,52 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
kubeconfig(credentialsId: 'k3s-kubeconfig') {
|
kubeconfig(credentialsId: 'k3s-kubeconfig') {
|
||||||
sh 'cat k8s/deployment-test.yaml | sed "s/latest/$BUILD_NUMBER/g" | kubectl apply -n swiss -f -'
|
|
||||||
sh 'kubectl apply -f k8s/service-test.yaml -n swiss'
|
|
||||||
sh 'cat k8s/deployment.yaml | sed "s/latest/$BUILD_NUMBER/g" | kubectl apply -n swiss -f -'
|
sh 'cat k8s/deployment.yaml | sed "s/latest/$BUILD_NUMBER/g" | kubectl apply -n swiss -f -'
|
||||||
sh 'kubectl apply -f k8s/service.yaml -n swiss'
|
sh 'kubectl apply -f k8s/service.yaml -n swiss'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stage('Checkout test') {
|
||||||
|
steps {
|
||||||
|
// This command checks out the source code from the SCM into the Jenkins workspace
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Build test') {
|
||||||
|
steps {
|
||||||
|
sh 'yarn install --no-progress'
|
||||||
|
sh 'npm run ng build --configuration test'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Docker Build test') {
|
||||||
|
steps {
|
||||||
|
sh 'docker build -t upquark/swiss-client-test:latest -t upquark/swiss-client-test:${BUILD_NUMBER} .'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Push the Docker Image to DockerHub') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
withCredentials([string(credentialsId: 'c7783e4f-2f79-482f-885f-dfb39f8c02d3', variable: 'docker_hub')]) {
|
||||||
|
sh 'docker login -u upquark -p ${docker_hub}'
|
||||||
|
}
|
||||||
|
sh 'docker push upquark/swiss-client-test:latest'
|
||||||
|
sh 'docker push upquark/swiss-client-test:${BUILD_NUMBER}'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy to Kubernetes') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
kubeconfig(credentialsId: 'k3s-kubeconfig') {
|
||||||
|
sh 'cat k8s/deployment-test.yaml | sed "s/latest/$BUILD_NUMBER/g" | kubectl apply -n swiss -f -'
|
||||||
|
sh 'kubectl apply -f k8s/service-test.yaml -n swiss'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
angular.json
11
angular.json
@@ -69,6 +69,17 @@
|
|||||||
"with": "src/environments/environment.development.ts"
|
"with": "src/environments/environment.development.ts"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"optimization": false,
|
||||||
|
"extractLicenses": false,
|
||||||
|
"sourceMap": true,
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.test.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "production"
|
"defaultConfiguration": "production"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: swiss-test-client
|
- name: swiss-test-client
|
||||||
image: upquark/swiss-client:latest
|
image: upquark/swiss-client-test:latest
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 4000
|
- containerPort: 4000
|
||||||
|
|||||||
4
src/environments/environment.test.ts
Normal file
4
src/environments/environment.test.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export const environment = {
|
||||||
|
production: false,
|
||||||
|
backendUrl: "https://backend-test.badminton-toernooi.nl",
|
||||||
|
};
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: true,
|
production: true,
|
||||||
// backendUrl: "http://swiss-backend.swiss.svc.cluster.local:8080",
|
|
||||||
backendUrl: "https://backend.badminton-toernooi.nl",
|
backendUrl: "https://backend.badminton-toernooi.nl",
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user