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
| provider "helm" { | |
| kubernetes { | |
| host = "https://${google_container_cluster.primary.endpoint}" | |
| token = data.google_client_config.default.access_token | |
| } | |
| } | |
| resource "helm_release" "example" { | |
| name = "my-local-chart" | |
| chart = "./helm" |
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
| # google_client_config and kubernetes provider must be explicitly specified like the following. | |
| # Retrieve an access token as the Terraform runner | |
| data "google_client_config" "default" {} | |
| # GKE cluster | |
| resource "google_container_cluster" "primary" { | |
| name = "my-gke" | |
| project = var.project | |
| location = var.region |
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
| #!/bin/bash | |
| USE_CLOUD=false | |
| while getopts 'ca:' OPTION; do | |
| case "$OPTION" in | |
| c) | |
| USE_CLOUD=true | |
| ;; | |
| a) |
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
| steps: | |
| # Build the container image and push it with Kaniko | |
| - name: 'gcr.io/kaniko-project/executor:latest' | |
| args: | |
| - --cache=true | |
| - --dockerfile=${_DOCKER_FILE} | |
| - --build-arg=SRC_DIR=${_APP} | |
| - --destination=eu.gcr.io/$PROJECT_ID/${_APP}:$COMMIT_SHA |
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
| ARG BUILD_IMAGE="node:18-slim" | |
| ARG RUN_IMAGE="node:18-alpine" | |
| ############################## | |
| ######## build stage ######### | |
| FROM $BUILD_IMAGE AS builder | |
| ## NEW!! | |
| ARG SRC_DIR="" |
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
| use std::process::Command; | |
| use std::str; | |
| fn main() { | |
| // output() | |
| let out2 = Command::new("ls") | |
| .arg("-l") | |
| .arg("-a") | |
| .output() | |
| .expect("ls command failed to start"); |
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
| use std::process::Command; | |
| fn main() { | |
| // spawn() | |
| println!("Running via 'spawn()'"); | |
| let mut out = Command::new("ls") | |
| .arg("-l") | |
| .arg("-a") | |
| .spawn() |
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
| use std::process::Command; | |
| fn main() { | |
| // Build the command | |
| let command = Command::new("ls") | |
| .arg("-l") | |
| .arg("-a") | |
| //... continue ... | |
| } |
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
| steps: | |
| # Build the container image and push it with Kaniko | |
| - name: 'gcr.io/kaniko-project/executor:latest' | |
| args: | |
| - --cache=true | |
| - --destination=eu.gcr.io/$PROJECT_ID/kaniko-demo:$COMMIT_SHA |
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
| dist | |
| node_modules |
NewerOlder