-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscripts.groovy
33 lines (25 loc) · 1.08 KB
/
scripts.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
def install_node_dependencies() {
echo "installing the node application dependencies..."
sh 'npm install'
}
def build_node() {
echo "building the node application..."
sh 'npm run build'
}
def create_docker_image() {
echo "creating the docker image..."
withCredentials([usernamePassword(credentialsId: 'docker-hub-cred', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
sh 'docker build -t eslamdyba/amrs-in-warehouse-systems:postgressql-server-dev-0.0 --build-arg POSTGRES_USER=$POSTGRES_USER --build-arg POSTGRES_DB=$POSTGRES_DATABASE --build-arg POSTGRES_PASSWORD=$POSTGRES_PASSWORD -f docker-with-databases/Dockerfile .'
}
}
def push_docker_image() {
echo "pushing the docker image..."
withCredentials([usernamePassword(credentialsId: 'docker-hub-cred', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
sh "echo $PASS | docker login -u $USER --password-stdin"
sh 'docker push eslamdyba/amrs-in-warehouse-systems:postgressql-server-dev-0.0'
}
}
def deploy() {
echo 'deploying the application...'
}
return this