From dd4d9a977d71128dd60b7fba32af00010d46dc84 Mon Sep 17 00:00:00 2001 From: M9713 <m9713@student.jamk.fi> Date: Mon, 4 Oct 2021 18:16:33 +0000 Subject: [PATCH] Delete .gitlab-ci.yml --- backend-express/.gitlab-ci.yml | 103 --------------------------------- 1 file changed, 103 deletions(-) delete mode 100644 backend-express/.gitlab-ci.yml diff --git a/backend-express/.gitlab-ci.yml b/backend-express/.gitlab-ci.yml deleted file mode 100644 index 065578b..0000000 --- a/backend-express/.gitlab-ci.yml +++ /dev/null @@ -1,103 +0,0 @@ -stages: - - build - - test - - deploy-dev - - deploy-prod - -variables: - # Save manifest repository URL to a variable for clarity - MANIFEST_REPOSITORY: git@gitlab.labranet.jamk.fi:conduit-gitops/gitops.git - -build: - stage: build - image: - name: gcr.io/kaniko-project/executor:debug - entrypoint: [""] - script: - # build from dockerfile with Kaniko - - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile ./Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA - only: - - master - tags: - #assign shared runner - - general - -test: - stage: test - script: echo "insert tests here... " - tags: - # assign shared runner - - general - -deploy-dev: - stage: deploy-dev - image: alpine:latest - before_script: - # kustomize install - - apk add --no-cache git curl bash - - curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash - - mv kustomize /usr/local/bin/ - - - git config --global user.email "gitlabbu@gitloponer.com" - - git config --global user.name "GitLab CI" - - # add SSH key to runner from CI/CD variables so that it can push to repository - - apk add --no-cache --update openssh-client - - mkdir -p ~/.ssh - - chmod 700 ~/.ssh - - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa - - echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts - - chmod 400 ~/.ssh/known_hosts - - chmod 400 ~/.ssh/id_rsa - script: - # clone manifest repository - update image tag with kustomize - push changes to same repository - - git clone --single-branch --branch dev $MANIFEST_REPOSITORY - - ls -l - - cd gitops/dev/backend/ - - kustomize edit set image $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA - - cat kustomization.yaml - - git commit -am '[skip ci] DEV image updated' - - git push origin dev - only: - - master - tags: - # assign shared runner - - general - -deploy-prod: - stage: deploy-prod - image: alpine:latest - before_script: - # kustomize install - - apk add --no-cache git curl bash - - curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash - - mv kustomize /usr/local/bin/ - - - git config --global user.email "gitlabbu@gitloponer.com" - - git config --global user.name "GitLab CI" - - # add SSH key to runner from CI/CD variables so that it can push to repository - - apk add --no-cache --update openssh-client - - mkdir -p ~/.ssh - - chmod 700 ~/.ssh - - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa - - echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts - - chmod 400 ~/.ssh/known_hosts - - chmod 400 ~/.ssh/id_rsa - script: - # clone manifest repository - update image tag with kustomize - push changes to same repository - - git clone --single-branch --branch master $MANIFEST_REPOSITORY - - ls -l - - cd gitops/prod/backend/ - - kustomize edit set image $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA - - cat kustomization.yaml - - git commit -am '[skip ci] PROD image updated' - - git push origin master - only: - - master - tags: - # assign shared runner - - general - # requires manual approval to deploy to production - when: manual -- GitLab