github.com/bilus/oya@v0.0.3-0.20190301162104-da4acbd394c6/TUTORIAL.md (about) 1 # Oya tutorial 2 3 ## What is Oya 4 5 Oya lets you bootstrap CI/CD for your project using ready-made packs supporting various workflows and CI/CD tools. 6 7 ## Install Oya and its dependencies 8 9 curl https://raw.githubusercontent/bilus/oya/master/scripts/setup.sh | bash 10 11 12 ## Our application 13 14 The application we will work with is a Hello world of HTTP servers written in Golang. 15 16 To get you quickly started, simply clone the following repository: TODO 17 18 It contains `hello/main.go` with the source code of the HTTP server. 19 20 21 ## Deploying it to GKE 22 23 I'll show you how to deploy the Hello world app as a Docker container running on the Google Kubernetes Engine (TODO: One-sentence explanation). 24 25 The first step is initializing the repository: 26 27 oya init 28 29 All it does is generate an empty Oyafile in the root directory. 30 31 Let's dockerize our app using an Oya pack that makes it easy. First, install the pack: 32 33 oya get github.com/bilus/oya/packs/docker [--alias docker] 34 35 Then, generate the assets necessary to put the application into a Docker image: 36 37 oya generate docker hello 38 39 The command invokes an Oya generator named "docker" passing it the path to the Hello world application as an argument. The command will generate a few files: 40 41 ``` 42 hello/ 43 Oyafile 44 Dockerfile 45 ``` 46 47 Oyafile contains Oya configuration, Dockerfile contains the instructions of how to build the Docker image. 48 49 > In general syntax of the `generate` Oya command is: `oya generate <generator> <args>`. You can list the available generators like so: `oya generate list`. 50 51 Let's build the image: 52 53 oya run docker.build 54 55 oya docker build 56 57 > If you run this command in the root directory, it'll build docker images for all applications you used the `oya generate docker` command on. In our case, it's just the Hello world app. You can also run it in a specific app's directory. 58 59 60 HERE NEXT 61 62 We need to tell Oya this is what we want to do: 63 64 oya get github.com/bilus/oya/packs/gke 65 66 The command installs the gke pack. We'll also need the docker pack to simplify putting our app in a docker container: 67 68 oya get github.com/bilus/oya/packs/docker 69 70 Let's generate code necessary to deploy our app in a docker container: 71 72 cd hello 73 oya generate g 74 75 76 77 ## Adding CI/CD