This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| echo "CREATE DATABASE sampledb" | PGPASSWORD=password psql -h localhost -U user | |
| # or | |
| cat your.sql | PGPASSWORD=password psql -h localhost -U user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.1' | |
| services: | |
| postgres: | |
| image: 'postgres:13.2' | |
| container_name: postgres | |
| ports: | |
| - 5432:5432 | |
| environment: | |
| POSTGRES_USER: postgres |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.service; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.security.core.userdetails.User; | |
| import org.springframework.security.core.userdetails.UserDetails; | |
| import org.springframework.security.core.userdetails.UserDetailsService; | |
| import org.springframework.security.core.userdetails.UsernameNotFoundException; | |
| import org.springframework.security.crypto.password.PasswordEncoder; | |
| import org.springframework.stereotype.Service; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.config; | |
| import com.example.service.impl.AppUserDetailsService; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; | |
| import org.springframework.security.config.annotation.web.builders.HttpSecurity; | |
| import org.springframework.security.config.annotation.web.builders.WebSecurity; | |
| import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | |
| import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | |
| import org.springframework.security.crypto.password.PasswordEncoder; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| deploy-to-aws: | |
| ...略 | |
| - steps: | |
| ...略 | |
| - name: Use Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: "3.8" | |
| - name: Use Node.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| deploy-to-aws: | |
| ...略 | |
| - steps: | |
| ...略 | |
| - name: Deploy crawler with terraform | |
| run: |- | |
| cd section_18/crawler/env | |
| terraform init | |
| terraform plan -out dev.tfplan | |
| terraform apply dev.tfplan || touch build_failed.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| deploy-to-aws: | |
| needs: test-crawler-before-deploy-to-aws | |
| name: deploy-to-aws | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - name: Set PEM & SQL | |
| run: |- | |
| echo "$PEM" > section_18/crawler/proxy.pem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test-crawler-before-deploy-to-aws: | |
| name: test-crawler-before-deploy-to-aws | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - name: Set PEM | |
| run: |- | |
| echo "$PEM" > section_18/crawler/proxy.pem | |
| env: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| terraform { | |
| backend "remote" { | |
| organization = "YOUR_ORG" | |
| workspaces { | |
| name = "YOUR_WORKSPACE" | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Section 17 crawler test | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| test-crawler: | |
| name: test-crawler | |
| runs-on: ubuntu-latest | |
| steps: |