File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,23 @@ jobs:
2626 cache : maven
2727
2828 - name : Build with Maven # Step to build the project with Maven
29- run : mvn clean install
29+ run : mvn -f demo/pom.xml clean install
3030
3131 - name : build and push the docker image to dockerhub
3232 run : |
3333 # 1. Login to DockerHub
3434 # 2. Build the Docker image
3535 # 3. Push the Docker image to DockerHub
36+ # 4. Run the Docker image
37+ # 5. Fetch logs from the running container
38+ # 6. Stop the container after the test
39+ # 7. Remove the container after the test
40+ # 8. Cleanup dangling images (optional)
3641 docker login -u gowthamdineshrajkumar -p gowthamdineshrajkumar
37- docker build -t gowthamdineshrajkumar/demospringboot .
38- docker push gowthamdineshrajkumar/demospringboot:latest
42+ docker build -f demo/Dockerfile -t gowthamdineshrajkumar/demospringboot .
43+ docker push gowthamdineshrajkumar/demospringboot:latest
44+ docker run -d --name demospringboot-container -p 8080:8080 gowthamdineshrajkumar/demospringboot:latest
45+ docker logs --tail 50 demospringboot-container
46+ docker stop demospringboot-container
47+ docker rm demospringboot-container
48+ docker image prune -f
You can’t perform that action at this time.
0 commit comments