전체 글
-
pull_request event 로 activity_type 살펴보기github actions 2022. 2. 27. 16:57
문제 event 에 대한 github actions 문서를 보면 push 의 경우에는 딱히 더 설정할 activity 가 없지만, pull_request 는 activity 를 추가로 설정할 수 있다. 예제 코드를 작성해 보자 코드 name: Pull Request Action on: push: pull_request: types: [opened, reopend, closed] jobs: run-github-actions: runs-on: ubuntu-latest steps: - name: List Files run: | pwd ls -a 참고: https://www.udemy.com/course/github-actions
-
checkout action 사용해 보기github actions 2022. 2. 26. 22:32
문제 https://github.com/actions/checkout 의 checkout action 을 사용해 코드를 clone & checkout 해 보자 코드 name: Checkout Action on: - push jobs: run-github-actions: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v1 with: ref: master - name: List Files run: | pwd ls -a echo $GITHUB_SHA echo $GITHUB_REPOSITORY echo $GITHUB_WORKSPACE echo "${{ github.token }}" 설명 github actions marketplace..
-
uses 로 action 사용해 보기github actions 2022. 2. 26. 21:59
문제 https://github.com/actions/hello-world-javascript-action 에 만들어져 있는 "actions/hello-world-javascript-action" 를 사용해보자. README 문서를 보면 Input 으로 who-to-greet 를 받는다. Output 으로 time 변수에 출력시간을 저장해 준다. 코드 name: Actions Workflow on: - push jobs: run-github-actions: runs-on: ubuntu-latest steps: - name: Simple JS Action id: greet uses: actions/hello-world-javascript-action@v1.1 with: who-to-greet: windbi..
-
Spark Dataset joinWith bug?spark 2022. 2. 26. 00:27
문제 아래 코드의 결과는 어떻게 될까? import org.apache.spark.sql.SparkSession object SparkTest { case class Person(name: String, age: Int, gender: String) def main(args: Array[String]): Unit = { val spark: SparkSession = SparkSession.builder().master("local[*]").getOrCreate() import spark.implicits._ val all = Seq(Person("Kim", 10, "M"), Person("Lee", 20, "M"), Person("Kim", 30, "F")).toDS() val males = all.fi..
-
scalatest-3.0.5 에서 scalacheck 의 generator 사용하기scala/scalatest 2022. 2. 19. 19:52
문제 scalatest 내에서 scalacheck 의 generator 를 사용해 보자. 아래 Person 인스턴스를 생성해 주는 generator 를 만들어 보자 case class Person(name: String, age: Int, isAdult: Boolean, gender: String, isMarried: Boolean) 코드 build.sbt 에 scalatest, scalacheck 라이브러리를 추가한다. libraryDependencies ++= Seq( "org.scalatest" %% "scalatest" % "3.0.5" % "test", "org.scalacheck" %% "scalacheck" % "1.13.5" % "test" ) Generator 와 테스트를 작성한다. pe..
-
다양한 Shell 사용하고 순차적으로 실행하기github actions 2022. 2. 13. 15:24
linux 서버 뿐만 아니라 windows 서버에서 workflow 를 실행할 수 있다. github actions shell 가이드 문서를 참고하도록 한다. python, windows shell 예제 name: Shell Commands on: - push jobs: run-shell-command: runs-on: ubuntu-latest steps: - name: python command run: | import platform print(platform.processor()) shell: python run-windows-command: runs-on: windows-latest steps: - name: Directory PowerShell run: Get-Location - name: Di..
-
First Simple Workflowgithub actions 2022. 2. 13. 14:44
workflow 파일 생성 ./github/workflows/simple.yml git clone https://github.com/windbird123/github-actions-test.git vi github-actions-test/.github/workflows/simple.yml name: Shell Commands on: - push jobs: run-shell-command: runs-on: ubuntu-latest steps: - name: echo a string run: echo "Hello World" - name: multiline script run: | node -v npm -v 코드 PUSH source code 뿐만 아니라 위의 simple.yml 파일을 PUSH 하게되면 g..
-
ansible rolesansible 2022. 2. 6. 22:39
전체 디렉토리 구조 ├── ansible.cfg ├── inventories │ ├── dev │ ├── group_vars │ │ └── all.yml │ └── real ├── playbooks │ └── playbook.yml └── roles └── mysql ├── README.md ├── defaults │ └── main.yml ├── files ├── handlers │ └── main.yml ├── meta │ └── main.yml ├── tasks │ └── main.yml ├── templates ├── tests │ ├── inventory │ └── test.yml └── vars └── main.yml Role 디렉토리 만들기 위의 roles/mysql 하위 디렉토리 구조가 복..