티스토리 뷰
[자동 배포]
- Travis를 이용한 자동배포
- S3 bucket에 파일들을 업로드 하는 방법.
(Travis CI, S3를 이용한 자동 배포 : https://jojoldu.tistory.com/265?category=635883 )
language: java
jdk:
- openjdk8
services:
- mysql
branches:
only:
- master
cache:
directories:
- '$Home/.gradle'
before_install:
- mysql -e 'CREATE DATABASE IF NOT EXISTS drinkit;'
- mysql -u root -e "CREATE USER 'jiwon'@'localhost' IDENTIFIED BY 'jiwon';"
- mysql -u root -e "GRANT ALL ON drinkit.* TO 'jiwon'@'localhost';"
script:
- travis_wait 30 ./gradlew clean build
before_deploy:
- zip -r drinkit *
- mkdir -p deploy
- mv drinkit.zip deploy/drinkit.zip
deploy:
- provider: s3
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
bucket: drinkit-bucket
region: ap-northeast-2
skip_cleanup: true
acl: public_read
wait-until-deployed: true
local_dir: deploy # deploy 디렉토리의 내용들만 S3로 전송
on:
repo: DrinKit-team-project/DrinKit-Backend
branch: master
- provider: codedeploy
access_key_id: $AWS_ACCESS_KEY # Travis repo settings에 설정된 값
secret_access_key: $AWS_SECRET_KEY # Travis repo settings에 설정된 값
bucket: drinkit-bucket # S3 버킷
key: drinkit.zip # 빌드 파일을 압축해서 전달
bundle_type: zip
application: drinkit # 웹 콘솔에서 등록한 CodeDeploy 어플리케이션
deployment_group: drinkit-group # 웹 콘솔에서 등록한 CodeDeploy 배포 그룹
region: ap-northeast-2
wait-until-deployed: true
on:
repo: DrinKit-team-project/DrinKit-Backend
branch: master
[Spring 디버거 사용방법 : http://jinhokwon.tistory.com/14, http://wonwoo.ml/index.php/post/396]
- log.debug("");
private static final Logger log = LoggerFactory.getLogger(AdminController.class);
[Spring Boot RestFul API 어노테이션]
@RequestBody : http://lee-mandu.tistory.com/242
@PostMapping("/menus")
public MenuDto createMenu(@RequestBody String menuTotalInfo) {
@JsonProperty : https://goo.gl/JZM9aR
@Column(name="ACCOUNT_USERNAME")
@JsonProperty("nickname")
private String username;
JPA 관련 어노테이션 : https://jdm.kr/blog/121, http://wonwoo.ml/index.php/post/1530
@JsonIgnore
@Column(name = "ACCOUNT_REVIEWS")
@OneToMany(mappedBy = "writer")
private List<Review> reviews = new ArrayList<>();
@ManyToMany(cascade = {
CascadeType.PERSIST,
CascadeType.MERGE
})
@JoinTable(name = "account_menu",
joinColumns = @JoinColumn(name = "account_id"),
inverseJoinColumns = @JoinColumn(name = "menu_id")
)
@MappedSuperclass
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class BaseEntity {
@CreatedDate
private LocalDateTime createdDate;
@LastModifiedDate
private LocalDateTime modifiedDate;
@RequestHeader
@PathVariable, @RequestParam, ResponseEntity
Exception 생성하여 사용하는 방법
[Spring Security]
Authentication
@Swagger
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.ant("/api/**"))
.build();
}
}
@EnableWebMvc : http://modestdeveloper.tumblr.com/post/31971657507/enablewebmvc
@Configuration
@EnableWebMvc
public class WebMvcConfig implements WebMvcConfigurer {
@Bean
public FilterRegistrationBean<CharacterEncodingFilter> registercharacterEncodingFilterBean() throws Exception {
FilterRegistrationBean<CharacterEncodingFilter> filterRegistrationBean = new FilterRegistrationBean<>(characterEncodingFilter());
filterRegistrationBean.setName("CharacterEncodingFilter");
filterRegistrationBean.addUrlPatterns("/api/**");
filterRegistrationBean.setOrder(1);
return filterRegistrationBean;
}
private CharacterEncodingFilter characterEncodingFilter() {
CharacterEncodingFilter characterEncodingFilter = new CharacterEncodingFilter();
characterEncodingFilter.setEncoding("UTF-8");
characterEncodingFilter.setForceEncoding(true);
return characterEncodingFilter;
}
}
'Back-end' 카테고리의 다른 글
[Spring Boot]원격 서버에 배포하기 (0) | 2018.09.20 |
---|---|
[SpringBoot] 코드 리팩토링 (0) | 2018.09.18 |
[SpringBoot] 자기 자신에 한해 개인정보 수정 (0) | 2018.09.18 |
[SpringBoot] 로그인 상태에 따른 메뉴처리, 로그아웃 (0) | 2018.09.18 |
Spring Boot 로컬 개발환경 세팅 (0) | 2018.09.11 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- docker
- 항해솔직후기
- front
- 월급쟁이부자들
- 깃
- 부동산공부
- 월부닷컴
- 재테크공부
- pop_back
- 유즈케이스
- push_back
- 폭포수
- 항해플러스백엔드
- 관계대수
- 개발자 회고
- 2023년
- Spring boot
- 깃허브
- Inception
- 내년은 빡세게!!
- 도커
- GIT
- resize
- github
- 인셉션
- 열반스쿨기초반
- 항해플러스후기
- Use case
- ```````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
- 파라메터
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함