{"id":19766202,"url":"https://github.com/akaliutau/gitlab-automation","last_synced_at":"2026-05-16T08:40:33.874Z","repository":{"id":210037872,"uuid":"565152920","full_name":"akaliutau/gitlab-automation","owner":"akaliutau","description":"GCP automation via GitLab","archived":false,"fork":false,"pushed_at":"2023-11-30T12:07:20.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T10:55:21.780Z","etag":null,"topics":["gcp","gcp-automation-gitops","gitlab","gitlab-ci","gitlab-runner"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akaliutau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-11-12T14:03:21.000Z","updated_at":"2023-11-30T12:08:57.000Z","dependencies_parsed_at":"2023-11-30T13:29:21.149Z","dependency_job_id":"85c1c3e1-9945-4ec4-bd7b-e73245bbfeb9","html_url":"https://github.com/akaliutau/gitlab-automation","commit_stats":null,"previous_names":["akaliutau/gitlab-automation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akaliutau/gitlab-automation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akaliutau%2Fgitlab-automation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akaliutau%2Fgitlab-automation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akaliutau%2Fgitlab-automation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akaliutau%2Fgitlab-automation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akaliutau","download_url":"https://codeload.github.com/akaliutau/gitlab-automation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akaliutau%2Fgitlab-automation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266854301,"owners_count":23995482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gcp","gcp-automation-gitops","gitlab","gitlab-ci","gitlab-runner"],"created_at":"2024-11-12T04:23:04.225Z","updated_at":"2026-05-16T08:40:33.829Z","avatar_url":"https://github.com/akaliutau.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GCP automation via GitLab\n\nThis repository contains PoCs for various experimental DevOps approaches when harnessing GitLab to perform deployment of dockerized applications to the Cloud   \n\nIn particular, the idea of _dynamically generated CI/CD pipeline_ is investigated (ie. `gitlab-ci.yml` file or its parts are generated in runtime)\n\n# Pre-requisites\n\n- gcloud (with non-null value of env var GOOGLE_APPLICATION_CREDENTIALS)\n- npm\n- python3.8\n- account at GitLab \n\n# Creating sample application\n\nTo demonstrate how to work with containerized apps, we are going to use a simple node.js app\n\n## Local run\n\n```shell\ncd ./app\nnpm install\nnode index.js\n```\n\nGo to localhost:8080 and observe \"Hello, World!\" simple web page\n\n## Dockerize and publish app to GCR\n\n```shell\nsudo docker build -t nodejs-demo:1.0.0 .\nsudo docker images\nsudo docker run -ti --name nodejs-app -p 8080:8080 -d nodejs-demo:1.0.0\n```\n\n(In case of \"container already running error\", stop that container with command `sudo docker rm \u003ccontainer_id\u003e`)\n\nThe last command will run the container with app in a daemon mode; it can also be visible using the docker command:\n\n```shell\nsudo docker ps\n\nCONTAINER ID   IMAGE         COMMAND                  CREATED          STATUS          PORTS                                       NAMES\n6aadf0b63d2f   nodejs-demo   \"docker-entrypoint.s…\"   24 seconds ago   Up 23 seconds   0.0.0.0:8080-\u003e8080/tcp, :::8080-\u003e8080/tcp   nodejs-app\n```\n\nTo stop container, type the command:\n\n```shell\nsudo docker stop 6aadf0b63d2f\n```\n\nAfter successful testing tag and publish docker to GCR:\n\n```shell\nGOOGLE_CLOUD_PROJECT=gcp-tooling-api\ngcloud config set project gcp-tooling-api\ngcloud services enable containerregistry.googleapis.com \nsudo docker tag nodejs-demo:1.0.0 eu.gcr.io/$GOOGLE_CLOUD_PROJECT/nodejs-demo:v1\nsudo docker push eu.gcr.io/$GOOGLE_CLOUD_PROJECT/nodejs-demo:v1\n```\nTo create GCP infrastructure with aforementioned simple app, use the script `gcp/create_insfrastructure.sh`\n\nThis script will do the following:\n\n- create template for instance in instance group\n- create managed instance group itself\n- create and attach auto-scaling policy to instance group\n\n# Building image for GitLab Runner\n\nFirst for convinience create env variables `GITLAB_USERNAME`, `GITLAB_PASSWORD` to hold GitLab's docker registry creds (note, this is not the secure place to hold secrets and consider using providers); set docker registry url via `export GITLAB_DOCKER_REGISTRY=registry.gitlab.com`:\n\n```\nsudo nano ~/.profile\nsource ~/.profile\n```\nThe following commands build and push image for GitLab runners\n\n```\ncd ./docker\nexport GROUP=\u003cname of the group\u003e\n./build_image.sh\n```\n\nNote the image URL - it can be used now for GitLab Runners.\n\nCreate a GitLab trigger token (Settings -\u003e CI/CD -\u003e Pipeline triggers) and put it into `GITLAB_TOKEN` env variable.\nCreate a GitLab access token (PAT, User Settings -\u003e Access Tokens) and put it into `PAT_TOKEN` env variable.\nCreate a `RUNNER_CUSTOM_IMAGE` env variable in CI/CD area:\n\n```\ncurl --request POST --header \"PRIVATE-TOKEN: $PAT_TOKEN\" \\\n     \"https://gitlab.com/api/v4/projects/41024544/variables\" \\\n     --form \"key=RUNNER_CUSTOM_IMAGE\" \\\n     --form \"value=registry.gitlab.com/automation299/gitlab-automation:a9316a0\"\n```\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakaliutau%2Fgitlab-automation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakaliutau%2Fgitlab-automation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakaliutau%2Fgitlab-automation/lists"}