Skip to content
Open
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 .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BUILD_NUMBER=cloud-0.0.5
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
.env

.env.production
# dependencies
/node_modules
Expand Down
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:14

WORKDIR /usr/src/app

COPY package*.json ./
RUN npm install


COPY . .


EXPOSE 3000

CMD ["npm", "start"]
74 changes: 74 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
def component = [
Preprocess: false,
Hyper: false,
Train: false,
Test: false,
Bento: false
]
pipeline {
agent {
kubernetes {
yaml """
apiVersion: v1
kind: Pod
metadata:
labels:
jenkins/agent-type: kaniko
spec:
containers:
- name: jnlp
image: jenkins/inbound-agent:latest
resources:
requests:
memory: "512Mi"
cpu: "500m"
limits:
memory: "1024Mi"
cpu: "1000m"
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
command:
- /busybox/cat
tty: true
resources:
requests:
memory: "2048Mi"
cpu: "2000m"
limits:
memory: "4096Mi"
cpu: "4000m"
volumeMounts:
- name: docker-config
mountPath: /kaniko/.docker/
volumes:
- name: docker-config
secret:
secretName: docker-config
"""
}
}

environment {
DOCKERHUB_USERNAME = "shinyenggwak"
IMAGE_NAME = "jenkins-test"
}

stage("Build Docker Image & Push to Docker Hub") {
steps {
container("kaniko") {
script {
def context = "./app"
def dockerfile = "./app/Dockerfile"
def image = "${DOCKERHUB_USERNAME}/${IMAGE_NAME}:latest"

sh 'apk add --no-cache git'

sh "git clone https://github.com/moija-project/FrontEnd.git ./app"
sh "cd ./app && git checkout sy-development"

sh "/kaniko/executor --context ${context} --dockerfile ${dockerfile} --destination ${image}"
}
}
}
}
}