diff --git a/front-react/.gitlab-ci.yml b/front-react/.gitlab-ci.yml deleted file mode 100644 index 0ec177209fc5efeb522d03ce740349b01df2e934..0000000000000000000000000000000000000000 --- a/front-react/.gitlab-ci.yml +++ /dev/null @@ -1,100 +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/frontend/ - - 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: - - general - -deploy-prod: - stage: deploy-prod - image: alpine:latest - before_script: - # install kustomize - - 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/frontend/ - - 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