Skip to content

Commit

Permalink
Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislima committed Nov 5, 2024
1 parent 5a09d41 commit 21b4548
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ pipeline {
steps {
script {
// Comando para inserir um documento JSON no MongoDB

sh """
mongo ${MONGO_HOST}:${MONGO_PORT}/${MONGO_DATABASE} --eval '
db.${MONGO_COLLECTION}.insert({ name: "Jenkins", description: "Inserted from Jenkins Pipeline" });
db.${MONGO_COLLECTION}.insert({ name: "Jenkins", description: "Inserindo do pipeline" });
'
"""
}
Expand Down
11 changes: 11 additions & 0 deletions docker-compose-jenkins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- 50000:50000
volumes:
- ./jenkins_compose/jenkins_configuration:/var/jenkins_home
networks:
- my_network

mongodb:
image: mongo
Expand All @@ -21,6 +23,8 @@
MONGO_INITDB_ROOT_PASSWORD: root
volumes:
- /Users/user/Documents/mongodb:/data/db
networks:
- my_network

mongo-express:
image: mongo-express
Expand All @@ -31,6 +35,13 @@
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: root
ME_CONFIG_MONGODB_SERVER: mongodb
networks:
- my_network


networks:
my_network:
driver: bridge

# O código abaixo é usado para subir um outro container a partir de um dockerfile.
# Mude o nome e porta para refletir seu ambiente.
Expand Down

0 comments on commit 21b4548

Please sign in to comment.