Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nisum-cicd-task
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
nisum-cicd-task
Commits
7af5c7c6
Commit
7af5c7c6
authored
Nov 15, 2022
by
Muhammad Usman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update .gitlab-ci.yml
parent
20da54b1
Pipeline
#2422
failed with stages
in 6 minutes and 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
2 deletions
+32
-2
.gitlab-ci.yml
.gitlab-ci.yml
+32
-2
No files found.
.gitlab-ci.yml
View file @
7af5c7c6
.cache
:
cache
:
key
:
${CI_COMMIT_REF_SLUG}
policy
:
pull
paths
:
-
target/java-maven-app-1.1.0-SNAPSHOT.jar
stages
:
-
install
-
build
-
deploy
maven-job
:
stage
:
install
extends
:
.cache
image
:
maven:3-jdk-11
script
:
-
mvn clean package
-
mvn package
cache
:
policy
:
push
docker-build-job
:
stage
:
build
image
:
docker:latest
extends
:
.cache
image
:
docker:20.10.10
before_script
:
-
echo $DOCKER_REGISTRY_PASS | docker login -u $DOCKER_REGISTRY_USER --password-stdin
script
:
-
docker build -t nisum-cicd-task:latest
\ No newline at end of file
-
docker build -t usmanbaloch/nisum-cicd-task:latest .
-
docker push usmanbaloch/nisum-cicd-task:latest
services
:
-
docker:20.10.10-dind
deploy-on-k8s
:
stage
:
deploy
image
:
google/cloud-sdk
script
:
# Authenticate with GKE
-
echo "$SERVICE_ACCOUNT_KEY" > key.json
-
gcloud auth activate-service-account --key-file=key.json
-
gcloud config set project $GCP_PROJECT_NAME
-
gcloud config set container/cluster $GKE_CLUSTER_NAME
-
gcloud config set compute/zone $GKE_CLUSTER_ZONE
-
gcloud container clusters get-credentials $GKE_CLUSTER_NAME --zone $GKE_CLUSTER_ZONE --project $GCP_PROJECT_NAME
# - sed -i "s/<VERSION>/${CI_COMMIT_SHORT_SHA}/g" deployment.yaml
-
kubectl apply -f dep-nisum-cicd.yaml
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment