From c783f3bfad2dd60584ee10546d1c033b259393ef Mon Sep 17 00:00:00 2001 From: Dave Dietrick Date: Sun, 17 Nov 2024 17:18:36 +0100 Subject: [PATCH] Added go section, changed .gitlab-ci.yml to push to AWS ECR --- .gitlab-ci.yml | 49 ++++++++++++++++++++++++++++++++------------ docs/go/index.md | 1 + docs/go/sidebar.json | 6 ++++++ 3 files changed, 43 insertions(+), 13 deletions(-) create mode 100644 docs/go/index.md create mode 100644 docs/go/sidebar.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1222374..7552f32 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,19 +1,42 @@ variables: - SERVICE_NAME: "docs" + DOCKER_REGISTRY: 015470951279.dkr.ecr.us-east-1.amazonaws.com + REPOSITORY_NAME: djdietrick/docs + DOCKER_HOST: tcp://docker:2375 stages: + - build - deploy -deploy: - stage: deploy - only: - - master # This pipeline stage will run on this branch alone +build: + stage: build + image: + name: amazon/aws-cli + entrypoint: [""] + services: + - docker:dind + before_script: + - amazon-linux-extras install docker + script: | + docker build -t $DOCKER_REGISTRY/$REPOSITORY_NAME:$CI_PIPELINE_ID . + aws ecr get-login-password | docker login --username AWS --password-stdin $DOCKER_REGISTRY + docker push $DOCKER_REGISTRY/$REPOSITORY_NAME:$CI_PIPELINE_ID - image: google/cloud-sdk:latest # We'll use Google Cloud SDK for Cloud Run related commands - script: - - echo $GCP_SERVICE_ACCOUNT > gcloud-service-key.json # Save Google cloud contents in a temporary json file - - gcloud auth activate-service-account --key-file gcloud-service-key.json # Activate your service account - - gcloud auth configure-docker # Configure docker environment - - gcloud config set project $GCP_PROJECT_ID #Set the GCP Project ID to the variable name - - gcloud builds submit --tag gcr.io/$GCP_PROJECT_ID/$SERVICE_NAME #Run the gcloud build command to build our image - - gcloud run deploy $SERVICE_NAME --image gcr.io/$GCP_PROJECT_ID/$SERVICE_NAME --region=us-east4 --platform managed --allow-unauthenticated # Run the gcloud run deploy command to deploy our new service \ No newline at end of file +# variables: +# SERVICE_NAME: "docs" + +# stages: +# - deploy + +# deploy: +# stage: deploy +# only: +# - master # This pipeline stage will run on this branch alone + +# image: google/cloud-sdk:latest # We'll use Google Cloud SDK for Cloud Run related commands +# script: +# - echo $GCP_SERVICE_ACCOUNT > gcloud-service-key.json # Save Google cloud contents in a temporary json file +# - gcloud auth activate-service-account --key-file gcloud-service-key.json # Activate your service account +# - gcloud auth configure-docker # Configure docker environment +# - gcloud config set project $GCP_PROJECT_ID #Set the GCP Project ID to the variable name +# - gcloud builds submit --tag gcr.io/$GCP_PROJECT_ID/$SERVICE_NAME #Run the gcloud build command to build our image +# - gcloud run deploy $SERVICE_NAME --image gcr.io/$GCP_PROJECT_ID/$SERVICE_NAME --region=us-east4 --platform managed --allow-unauthenticated # Run the gcloud run deploy command to deploy our new service diff --git a/docs/go/index.md b/docs/go/index.md new file mode 100644 index 0000000..452b575 --- /dev/null +++ b/docs/go/index.md @@ -0,0 +1 @@ +# Go diff --git a/docs/go/sidebar.json b/docs/go/sidebar.json new file mode 100644 index 0000000..7d08ba6 --- /dev/null +++ b/docs/go/sidebar.json @@ -0,0 +1,6 @@ +[ + { + "text": "Go Basics", + "items": [{ "text": "Introduction", "link": "/go/" }] + } +]