diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 0c223d5..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,58 +0,0 @@ -pipeline { - agent any - - stages { - stage('Build') { - steps { - echo 'Compilation du code...' - // Add your build commands here - } - } - stage('Test') { - steps { - echo 'Exécution des tests...' - // Add your test commands here - } - } - stage('Deploy') { - steps { - echo 'Déploiement sur Portainer...' - - // Obtain an authentication token from Portainer - withCredentials([usernamePassword(credentialsId: 'portainer-credentials', usernameVariable: 'PORTAINER_USERNAME', passwordVariable: 'PORTAINER_PASSWORD')]) { - script { - // Create a JSON object for the authentication request - def authRequestBody = groovy.json.JsonOutput.toJson([ - Username: PORTAINER_USERNAME, - Password: PORTAINER_PASSWORD - ]) - - // Send the authentication request without logging sensitive data - def response = httpRequest( - httpMode: 'POST', - contentType: 'APPLICATION_JSON', - url: "http://portainer.canguidev.fr/api/auth", - requestBody: authRequestBody, - consoleLogResponseBody: false // Prevent logging the response body - ) - - def json = readJSON text: response.content - env.PORTAINER_TOKEN = json.jwt - } - } - - // Deploy the stack on Portainer using the obtained token - httpRequest( - httpMode: 'PUT', - customHeaders: [[name: 'Authorization', value: "Bearer ${env.PORTAINER_TOKEN}"]], - url: "http://portainer.canguidev.fr/api/stacks/canguidev/deploy", - contentType: 'APPLICATION_JSON', - requestBody: '{"Prune": true}', - consoleLogResponseBody: false // Prevent logging the response body - ) - - echo 'Déploiement terminé.' - } - } - } -} diff --git a/docker-compose.yml b/docker-compose.yml index 858f05c..24c88c0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,13 +1,15 @@ -version: '3.7' +version: '3' services: web: - image: my-image:latest + build: . ports: - "8084:80" networks: - canguidev_default - npm-network - deploy: - update_config: - parallelism: 1 - pull_policy: always + +networks: + canguidev_default: + external: true + npm-network: + external: true