Skip to content

Commit

Permalink
Fix to Deploy automatic Docker image (#62)
Browse files Browse the repository at this point in the history
- Added /target folder
- Renamed docker tag name on job .yml
  • Loading branch information
LauroSilveira authored Oct 26, 2023
1 parent 7f1241a commit 949b2e8
Show file tree
Hide file tree
Showing 208 changed files with 4,336 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
uses: docker/build-push-action@v5
with:
push: true
tags: laurocorreia/reactive-api:latest
tags: laurocorreia/alura-flix-api:latest
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
HELP.md
target/

!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ ARG DATABASE_TEST
## work directory by default
WORKDIR /alura-flix-api
## copy all files from target and put in to work directory
COPY /target/alura-flix-api-0.0.1-SNAPSHOT.jar alura-flix-api.jar
COPY target/alura-flix-api-0.0.1-SNAPSHOT.jar alura-flix-api.jar
ENTRYPOINT ["java", "-jar", "alura-flix-api.jar"]
19 changes: 19 additions & 0 deletions target/classes/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
server:
port: 8080
# Disable StackTrace of Spring on response when an error happen
error:
include-stacktrace: never

spring:
application:
name: alura-flix-api
data:
mongodb:
database: alura-flix
# always commit the uri like this: ${DATABASE_PRO}
uri: ${DATABASE_PRO:mongodb+srv://alura-flix-admin:UxOM6SSAtQHpDeEd@alura-flix.z61opfc.mongodb.net/?retryWrites=true&w=majority}

api:
security:
# always commit the uri like this: ${JWT_SECRET}
token-jwt-secret: ${JWT_SECRET:123456}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package com.alura.aluraflixapi.infraestructure.mapper;

import com.alura.aluraflixapi.domain.category.Category;
import com.alura.aluraflixapi.domain.category.dto.CategoryDto;
import javax.annotation.processing.Generated;
import org.springframework.stereotype.Component;

@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2023-10-11T11:12:17+0200",
comments = "version: 1.5.5.Final, compiler: javac, environment: Java 17.0.4 (Oracle Corporation)"
)
@Component
public class CategoryMapperImpl implements CategoryMapper {

@Override
public Category mapperToEntity(CategoryDto categoryDto) {
if ( categoryDto == null ) {
return null;
}

Category.CategoryBuilder category = Category.builder();

category.id( categoryDto.id() );
category.rating( categoryDto.rating() );
category.title( categoryDto.title() );
category.colorHex( categoryDto.colorHex() );

return category.build();
}

@Override
public CategoryDto mapperToCategoryDto(Category categorySaved) {
if ( categorySaved == null ) {
return null;
}

String id = null;
String rating = null;
String title = null;
String colorHex = null;

id = categorySaved.getId();
rating = categorySaved.getRating();
title = categorySaved.getTitle();
colorHex = categorySaved.getColorHex();

CategoryDto categoryDto = new CategoryDto( id, rating, title, colorHex );

return categoryDto;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package com.alura.aluraflixapi.infraestructure.mapper;

import com.alura.aluraflixapi.domain.user.User;
import com.alura.aluraflixapi.domain.user.dto.UserDto;
import com.alura.aluraflixapi.domain.user.roles.Roles;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.processing.Generated;
import org.springframework.stereotype.Component;

@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2023-10-11T11:12:17+0200",
comments = "version: 1.5.5.Final, compiler: javac, environment: Java 17.0.4 (Oracle Corporation)"
)
@Component
public class UserMapperImpl implements UserMapper {

@Override
public User mappToEntity(UserDto dto) {
if ( dto == null ) {
return null;
}

User.UserBuilder user = User.builder();

user.password( password( dto.password() ) );
user.id( dto.id() );
user.username( dto.username() );
List<Roles> list = dto.roles();
if ( list != null ) {
user.roles( new ArrayList<Roles>( list ) );
}

return user.build();
}

@Override
public UserDto mappToDto(User newUser) {
if ( newUser == null ) {
return null;
}

String id = null;
String username = null;
String password = null;
List<Roles> roles = null;

id = newUser.getId();
username = newUser.getUsername();
password = newUser.getPassword();
List<Roles> list = newUser.getRoles();
if ( list != null ) {
roles = new ArrayList<Roles>( list );
}

UserDto userDto = new UserDto( id, username, password, roles );

return userDto;
}

@Override
public List<UserDto> mappToUsersDto(List<User> users) {
if ( users == null ) {
return null;
}

List<UserDto> list = new ArrayList<UserDto>( users.size() );
for ( User user : users ) {
list.add( mappToDto( user ) );
}

return list;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
package com.alura.aluraflixapi.infraestructure.mapper;

import com.alura.aluraflixapi.domain.category.Category;
import com.alura.aluraflixapi.domain.category.dto.CategoryDto;
import com.alura.aluraflixapi.domain.video.Video;
import com.alura.aluraflixapi.domain.video.dto.UpdateVideoDto;
import com.alura.aluraflixapi.domain.video.dto.VideoDto;
import javax.annotation.processing.Generated;
import org.springframework.stereotype.Component;

@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2023-10-11T11:12:17+0200",
comments = "version: 1.5.5.Final, compiler: javac, environment: Java 17.0.4 (Oracle Corporation)"
)
@Component
public class VideoMapperImpl implements VideoMapper {

@Override
public Video mapToModel(VideoDto dto) {
if ( dto == null ) {
return null;
}

Video.VideoBuilder video = Video.builder();

video.id( dto.id() );
video.title( dto.title() );
video.description( dto.description() );
video.url( dto.url() );
video.category( categoryDtoToCategory( dto.category() ) );

return video.build();
}

@Override
public VideoDto mapToVideoDto(Video video) {
if ( video == null ) {
return null;
}

VideoDto.VideoDtoBuilder videoDto = VideoDto.builder();

videoDto.id( video.getId() );
videoDto.title( video.getTitle() );
videoDto.description( video.getDescription() );
videoDto.url( video.getUrl() );
videoDto.category( categoryToCategoryDto( video.getCategory() ) );

return videoDto.build();
}

@Override
public UpdateVideoDto mapUpdateVideoDto(Video updateDto) {
if ( updateDto == null ) {
return null;
}

String id = null;
String title = null;
String description = null;
String url = null;
CategoryDto category = null;

id = updateDto.getId();
title = updateDto.getTitle();
description = updateDto.getDescription();
url = updateDto.getUrl();
category = categoryToCategoryDto( updateDto.getCategory() );

UpdateVideoDto updateVideoDto = new UpdateVideoDto( id, title, description, url, category );

return updateVideoDto;
}

@Override
public Video mapUpdateVideoToModel(UpdateVideoDto updateVideoDto) {
if ( updateVideoDto == null ) {
return null;
}

Video.VideoBuilder video = Video.builder();

video.id( updateVideoDto.id() );
video.title( updateVideoDto.title() );
video.description( updateVideoDto.description() );
video.url( updateVideoDto.url() );
video.category( categoryDtoToCategory( updateVideoDto.category() ) );

return video.build();
}

protected Category categoryDtoToCategory(CategoryDto categoryDto) {
if ( categoryDto == null ) {
return null;
}

Category.CategoryBuilder category = Category.builder();

category.id( categoryDto.id() );
category.rating( categoryDto.rating() );
category.title( categoryDto.title() );
category.colorHex( categoryDto.colorHex() );

return category.build();
}

protected CategoryDto categoryToCategoryDto(Category category) {
if ( category == null ) {
return null;
}

String id = null;
String rating = null;
String title = null;
String colorHex = null;

id = category.getId();
rating = category.getRating();
title = category.getTitle();
colorHex = category.getColorHex();

CategoryDto categoryDto = new CategoryDto( id, rating, title, colorHex );

return categoryDto;
}
}
Binary file added target/jacoco.exec
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
com/alura/aluraflixapi/infraestructure/mapper/UserMapper.class
com/alura/aluraflixapi/controller/UserController.class
com/alura/aluraflixapi/domain/user/roles/Roles$RolesBuilder.class
com/alura/aluraflixapi/domain/category/Category$CategoryBuilder.class
com/alura/aluraflixapi/infraestructure/mapper/UserMapperImpl.class
com/alura/aluraflixapi/infraestructure/service/UserService.class
com/alura/aluraflixapi/infraestructure/security/SecurityConfigurations.class
com/alura/aluraflixapi/AluraFlixApiApplication.class
com/alura/aluraflixapi/domain/category/Rating.class
com/alura/aluraflixapi/infraestructure/repository/CategoryRepository.class
com/alura/aluraflixapi/domain/category/Category.class
com/alura/aluraflixapi/infraestructure/repository/VideoRepository.class
com/alura/aluraflixapi/domain/video/Video.class
com/alura/aluraflixapi/domain/video/dto/VideoDto$VideoDtoBuilder.class
com/alura/aluraflixapi/domain/video/dto/VideoDto.class
com/alura/aluraflixapi/domain/user/User$UserBuilder.class
com/alura/aluraflixapi/controller/CategoryController.class
com/alura/aluraflixapi/domain/user/User.class
com/alura/aluraflixapi/infraestructure/security/dto/TokenJwtDto.class
com/alura/aluraflixapi/controller/ControllerAdvice.class
com/alura/aluraflixapi/controller/AuthenticationController.class
com/alura/aluraflixapi/infraestructure/security/TokenService.class
com/alura/aluraflixapi/infraestructure/springdoc/SpringdocConfiguration.class
com/alura/aluraflixapi/domain/user/roles/RoleEnum.class
com/alura/aluraflixapi/infraestructure/service/CategoryServiceImpl.class
com/alura/aluraflixapi/controller/dto/ErrorDto.class
com/alura/aluraflixapi/infraestructure/service/UserServiceImpl.class
com/alura/aluraflixapi/infraestructure/mapper/VideoMapper.class
com/alura/aluraflixapi/domain/user/dto/AuthenticationDto.class
com/alura/aluraflixapi/infraestructure/repository/UserRepository.class
com/alura/aluraflixapi/infraestructure/service/UserDetailsServiceImpl.class
com/alura/aluraflixapi/domain/user/roles/Roles.class
com/alura/aluraflixapi/infraestructure/mapper/CategoryMapper.class
com/alura/aluraflixapi/infraestructure/service/VideoServiceImpl.class
com/alura/aluraflixapi/infraestructure/mapper/VideoMapperImpl.class
com/alura/aluraflixapi/infraestructure/security/SecurityFilter.class
com/alura/aluraflixapi/domain/video/Video$VideoBuilder.class
com/alura/aluraflixapi/infraestructure/repository/RoleRepository.class
com/alura/aluraflixapi/controller/VideoController.class
com/alura/aluraflixapi/domain/user/dto/UserDto.class
com/alura/aluraflixapi/domain/category/dto/CategoryDto.class
com/alura/aluraflixapi/domain/video/dto/UpdateVideoDto.class
com/alura/aluraflixapi/domain/user/roles/RolesEnum.class
com/alura/aluraflixapi/infraestructure/exception/CategoryTransactionException.class
com/alura/aluraflixapi/infraestructure/service/VideoService.class
com/alura/aluraflixapi/infraestructure/mapper/CategoryMapperImpl.class
com/alura/aluraflixapi/infraestructure/service/CategoryService.class
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/domain/user/roles/Roles.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/domain/video/dto/VideoDto.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/domain/user/dto/AuthenticationDto.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/domain/user/User.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/repository/VideoRepository.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/security/dto/TokenJwtDto.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/service/CategoryService.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/service/UserServiceImpl.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/controller/UserController.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/controller/dto/ErrorDto.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/domain/video/Video.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/service/CategoryServiceImpl.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/mapper/CategoryMapper.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/domain/user/roles/RolesEnum.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/controller/ControllerAdvice.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/springdoc/SpringdocConfiguration.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/service/VideoServiceImpl.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/domain/category/Rating.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/exception/CategoryTransactionException.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/controller/CategoryController.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/security/TokenService.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/controller/VideoController.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/repository/CategoryRepository.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/controller/AuthenticationController.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/security/SecurityFilter.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/domain/video/dto/UpdateVideoDto.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/mapper/VideoMapper.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/AluraFlixApiApplication.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/repository/UserRepository.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/service/UserDetailsServiceImpl.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/repository/RoleRepository.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/domain/user/dto/UserDto.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/mapper/UserMapper.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/service/VideoService.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/domain/category/dto/CategoryDto.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/domain/category/Category.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/security/SecurityConfigurations.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/domain/user/roles/RoleEnum.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/main/java/com/alura/aluraflixapi/infraestructure/service/UserService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
com/alura/aluraflixapi/infraestructure/service/CategoryServiceImplTest.class
com/alura/aluraflixapi/controller/VideoControllerTest.class
com/alura/aluraflixapi/infraestructure/repository/VideoRepositoryTest.class
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/test/java/com/alura/aluraflixapi/controller/VideoControllerTest.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/test/java/com/alura/aluraflixapi/infraestructure/service/CategoryServiceImplTest.java
/Users/laurocorreia/Documents/GitHub/alura-flix-api/src/test/java/com/alura/aluraflixapi/infraestructure/repository/VideoRepositoryTest.java
Loading

0 comments on commit 949b2e8

Please sign in to comment.