Skip to content
Snippets Groups Projects
Commit 4a6d94f4 authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

refactor: remove unused gitlab-ci file

parent 4c6750c9
No related branches found
No related tags found
1 merge request!10Sprint #12
variables:
IMAGE_ORG: bogdandev
IMAGE_NAME: xpub-faraday
REPO_URL: https://gitlab.coko.foundation/xpub/xpub-faraday
stages:
- build
- test
- review
- docker
- demo
build-aws:
image: docker:stable
stage: build
services:
- docker:dind
variables:
IMAGE_REPO: faraday-qa
before_script:
- apk add --no-cache curl jq python py-pip
- pip install awscli
script:
- eval $(aws ecr get-login --no-include-email --region eu-west-1 | sed 's|https://||')
- docker build -t $IMAGE_REPO:$CI_COMMIT_SHA .
- docker tag $IMAGE_REPO:$CI_COMMIT_SHA $REPOSITORY_URL:latest
- docker push $REPOSITORY_URL:latest
build:
image: docker:stable
stage: build
script:
- docker version
- docker build -t $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA .
- if [ -z "$DOCKERHUB_USERNAME" ] || [ -z "$DOCKERHUB_PASSWORD" ]; then echo "Not pushing" && exit 0; fi
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- echo "Ignore warning! Cannot perform an interactive login from a non TTY device"
- docker push $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
lint:
image: $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
stage: test
variables:
GIT_STRATEGY: none
script:
- cd ${HOME}
- npm run lint
test:
image: $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
stage: test
variables:
GIT_STRATEGY: none
script:
- cd ${HOME}
- npm run test
# push:latest:
# image: docker:latest
# stage: docker
# script:
# - if [ -z "$DOCKERHUB_USERNAME" ] || [ -z "$DOCKERHUB_PASSWORD" ]; then echo "Not pushing" && exit 0; fi
# - docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
# - echo "Ignore warning! Cannot perform an interactive login from a non TTY device"
# - docker build -t $IMAGE_ORG/$IMAGE_NAME:latest --label COMMIT_SHA=$CI_COMMIT_SHA .
# - docker push $IMAGE_ORG/$IMAGE_NAME:latest
# only:
# - master
demo:qa:
image: $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
stage: demo
when: manual
variables:
PACKAGE_NAME: xpub-faraday
environment:
name: qa/$PACKAGE_NAME
url: https://xpub-faraday-qa.now.sh/
script:
- npm i -g --unsafe-perm now
- cd ${HOME}/now
- echo "FROM ${IMAGE_ORG}/${IMAGE_NAME}:${CI_COMMIT_SHA}" >> Dockerfile
- now --public --docker --token $NOW_TOKEN -e AWS_S3_ACCESS_KEY=$AWS_S3_ACCESS_KEY -e AWS_S3_SECRET_KEY=$AWS_S3_SECRET_KEY -e AWS_S3_REGION=$AWS_S3_REGION -e AWS_S3_BUCKET=$AWS_S3_BUCKET -e AWS_SES_SECRET_KEY=$AWS_SES_SECRET_KEY -e AWS_SES_ACCESS_KEY=$AWS_SES_ACCESS_KEY -e AWS_SES_REGION=$AWS_SES_REGION -e EMAIL_SENDER=$EMAIL_SENDER -e secret=$SECRET -e DATABASE=$DATABASE -e DB_USER=$DB_USER -e DB_PASS=$DB_PASS -e DB_HOST=$DB_HOST
- now alias $NOW_URL xpub-faraday-qa --token $NOW_TOKEN
demo:aws-qa:
image: $REPOSITORY_URL:latest
stage: demo
when: manual
variables:
PACKAGE_NAME: xpub-faraday
CLUSTER_NAME: faraday-cluster
environment:
name: qa/$PACKAGE_NAME
url: http://52.211.238.137/
script:
- export AWS_REGION="eu-west-1"
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
- export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
- eval $(aws ecr get-login --no-include-email --region eu-west-1 | sed 's|https://||')
- apk --no-cache add --update python python-dev py-pip
- pip install ecs-deploy
- ecs deploy --region ${AWS_REGION} ${CLUSTER_NAME} ${IMAGE_REPO}:${CI_COMMIT_SHA} --tag ${CI_COMMIT_SHA}
demo:staging:
image: $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
stage: demo
when: manual
variables:
PACKAGE_NAME: xpub-faraday
only:
- master
environment:
name: demo/$PACKAGE_NAME
url: https://xpub-faraday.now.sh/
script:
- npm i -g --unsafe-perm now
- cd ${HOME}/now
- echo "FROM ${IMAGE_ORG}/${IMAGE_NAME}:${CI_COMMIT_SHA}" >> Dockerfile
- now --public --docker --token $NOW_TOKEN -e AWS_S3_ACCESS_KEY=$AWS_S3_ACCESS_KEY -e AWS_S3_SECRET_KEY=$AWS_S3_SECRET_KEY -e AWS_S3_REGION=$AWS_S3_REGION -e AWS_S3_BUCKET=$AWS_S3_BUCKET -e AWS_SES_SECRET_KEY=$AWS_SES_SECRET_KEY -e AWS_SES_ACCESS_KEY=$AWS_SES_ACCESS_KEY -e AWS_SES_REGION=$AWS_SES_REGION -e EMAIL_SENDER=$EMAIL_SENDER -e secret=$SECRET -e DATABASE=$DATABASE_STAGING -e DB_USER=$DB_USER_STAGING -e DB_PASS=$DB_PASS_STAGING -e DB_HOST=$DB_HOST_STAGING
- now alias $NOW_URL xpub-faraday --token $NOW_TOKEN
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment