{"id":15794559,"url":"https://github.com/jlenon7/gitlab-deploy","last_synced_at":"2026-03-18T16:44:30.055Z","repository":{"id":121439736,"uuid":"426201408","full_name":"jlenon7/gitlab-deploy","owner":"jlenon7","description":"🐳 A docker image to use inside Gitlab CI","archived":false,"fork":false,"pushed_at":"2022-04-18T23:38:42.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-05T23:42:02.591Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","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/jlenon7.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-09T11:24:28.000Z","updated_at":"2021-12-16T13:23:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"85b1fa23-54cb-4568-a239-3a48d49d2512","html_url":"https://github.com/jlenon7/gitlab-deploy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlenon7%2Fgitlab-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlenon7%2Fgitlab-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlenon7%2Fgitlab-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlenon7%2Fgitlab-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlenon7","download_url":"https://codeload.github.com/jlenon7/gitlab-deploy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246525846,"owners_count":20791799,"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","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":[],"created_at":"2024-10-04T23:42:04.235Z","updated_at":"2026-02-27T15:44:45.137Z","avatar_url":"https://github.com/jlenon7.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gitlab Deploy 🐳\n\n\u003e A docker image to use inside Gitlab CI pipelines\n\nA simple docker image to help in your pipelines, `gitlab-deploy` is based in a `ubuntu` image and comes with `curl, make, zip, awscli, nvm, npm, nodejs, kubectl, helm and templating`.\nFeel free to make a `pull request` to add more content to this image.\n\n\u003cimg src=\".gitlab/gitlab-deploy.png\" width=\"200px\" align=\"right\" hspace=\"30px\" vspace=\"100px\"\u003e\n\n## Adding more content to this image\n\n\u003e Gitlab CI uses DIND to execute the steps from the pipeline. If you want to add more content to the image, always remember that your command should exist in the interactive mode to work inside the pipeline\n\n```yaml\n# You can find this step inside ./.gitlab-ci.yml file\n\n# This is the actual CI pipeline of this project and runs only on new merge_request\nBuild and test the image commands:\n  image: docker:latest\n  stage: test\n  script:\n    - docker build -t test-gitlab-deploy .\n    - docker run -i test-gitlab-deploy aws help\n    - docker run -i test-gitlab-deploy curl --help\n    - docker run -i test-gitlab-deploy zip -v\n    - docker run -i test-gitlab-deploy make -v\n    - docker run -i test-gitlab-deploy npm -v\n    - docker run -i test-gitlab-deploy node -v\n    - docker run -i test-gitlab-deploy templating -v\n    - docker run -i test-gitlab-deploy helm\n    - docker run -i test-gitlab-deploy kubectl\n    - docker run -i test-gitlab-deploy /bin/bash -c \"source /usr/local/bin/nvm/nvm.sh \u0026\u0026 nvm -v\"\n    # Add your command over here. Example -\u003e docker run -i test-gitlab-deploy javac\n  only:\n    - merge_requests\n```\n\n## Pipeline Example\n\n\u003e A .gitlab-ci.yml file as example\n\n```yaml\nservices:\n  - docker:18.09-dind\n\nvariables:\n  IMAGE_LATEST: nickname-organization/your-image-name-here:latest\n  IMAGE_TAG: nickname-organization/your-image-name-here:$CI_COMMIT_SHA\n\nstages:\n  - test\n  - build\n  - deploy\n\nVerify lint and run tests:\n  image: node:16.13.0\n  stage: test\n  services:\n    - redis:latest\n    - postgres:latest\n  variables:\n    POSTGRES_DB: \"postgres\"\n    POSTGRES_USER: \"postgres\"\n    POSTGRES_PASSWORD: \"root\"\n    DATABASE_URL_TESTING: \"postgresql://postgres:root@postgres:5432/postgres?schema=public\"\n  script:\n    - cp ./manifest/.env.ci .env.ci\n    - npm install --silent\n    - npm run lint:fix\n    - npm run test:ci\n  only:\n    - merge_requests\n\nBuild and push image to Dockerhub:\n  image: docker:latest\n  stage: build\n  script:\n    - echo \"$DOCKER_PASSWORD\" | docker login -u \"$DOCKER_USERNAME\" --password-stdin\n    - docker pull $IMAGE_LATEST || true\n    - docker build --cache-from $IMAGE_LATEST -t $IMAGE_TAG -t $IMAGE_LATEST .\n    - docker push $IMAGE_TAG\n    - docker push $IMAGE_LATEST\n  only:\n    - main\n\nDeploy image to K8S Cluster:\n  image: jlenon7/gitlab-deploy:latest\n  stage: deploy\n  script:\n    - aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID\n    - aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY\n    - aws configure set region $AWS_DEFAULT_REGION\n    - aws eks --region $AWS_DEFAULT_REGION update-kubeconfig --name eks-$AWS_DEFAULT_REGION-production\n    - templating generate ./manifest/templates --set IMAGE_TAG=$IMAGE_TAG\n    - kubectl apply -f ./manifest/config-map.yml -f ./manifest/deployment.yml\n  needs: [\"Build and push image to Dockerhub\"]\n  only:\n    - main\n```\n\n## Warning under nvm CLI\n\n\u003e To use nvm inside your pipelines you will need to use /bin/bash and source nvm.sh first\n\n```yaml\nExample:\n  image: jlenon7/gitlab-deploy:latest\n  stage: deploy\n  script:\n    # Install node 14.2 version and reinstall all global packages from version 16.2\n    - /bin/bash -c \"source /usr/local/bin/nvm/nvm.sh \u0026\u0026 nvm install 14.2.0 \u0026\u0026 nvm reinstall-packages 16.2.0\"\n  only:\n    - main\n```\n\n---\n\nMade with 🖤 by [jlenon7](https://github.com/jlenon7) 👋\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlenon7%2Fgitlab-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlenon7%2Fgitlab-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlenon7%2Fgitlab-deploy/lists"}