Commit 53a0cc7f authored by Rucha Deshpande's avatar Rucha Deshpande
Browse files

Add gitlab ci changes

parent 0c267b3e
Pipeline #32149 passed with stages
in 13 minutes and 46 seconds
......@@ -5,7 +5,16 @@ variables:
PORT: 80
REPLICA: 1
UTEST_RUNTIME_IMAGE: seistore-svc-runtime
#aws variables
AWS_SERVICE: seismic-store
AWS_BUILD_SUBDIR: src/cloud/providers/aws/build-aws
AWS_TEST_SUBDIR: tests
AWS_ENVIRONMENT: dev
AWS_BUILDER_DOCKERFILE_PATH: src/cloud/providers/aws/build-aws/builder.Dockerfile
AWS_RUNTIME_DOCKERFILE_PATH: src/cloud/providers/aws/build-aws/runtime.Dockerfile
# skipping tests here. Using a local file to run tests
AWS_SKIP_TESTS: "true"
#azure variables
AZURE_SERVICE: seismic-store-service
#gcp variables
......@@ -31,6 +40,12 @@ include:
- project: "osdu/platform/ci-cd-pipelines"
file: "containerize/seismic-store-service.yml"
# aws
- project: "osdu/platform/ci-cd-pipelines"
file: "cloud-providers/aws.yml"
- local: "/devops/aws/awstest.yml"
# deploy
#azure
- project: "osdu/platform/ci-cd-pipelines"
......@@ -40,6 +55,7 @@ include:
- project: "osdu/platform/ci-cd-pipelines"
file: "cloud-providers/ibm-seismic-store-service.yml"
#gcp
- project: "osdu/platform/ci-cd-pipelines"
file: "cloud-providers/gcp-seismic-store-service.yml"
aws-test-newman:
extends:
- .aws
- .aws_base_variables
- .aws_variables
stage: integration
image: node
needs: ['aws-update-ecs']
script:
- apt-get update
- apt-get install -y python
- apt-get install -y python-pip
- pip install -r devops/aws/requirements.txt
- svctoken=$(python devops/scripts/aws_jwt_client.py)
- echo $svctoken
- npm install -g newman
- chmod +x ./tests/e2e/run_e2e_tests.sh
- ./tests/e2e/run_e2e_tests.sh --seistore-svc-url=${SEISMICSTORE_SVC_URL} --seistore-svc-api-key="NA" --user-idtoken="$svctoken" --user-idtoken="$svctoken" --tenant=opendes --subproject=awsdemosubproject --admin-email="${AWS_COGNITO_AUTH_PARAMS_USER}" --datapartition=opendes --legaltag01=opendes-sdmstestlegaltag --legaltag02=opendes-sdmstestlegaltag --subproject-long-name=subprojectlonggggggggggggggggggggggname --VCS-Provider="${ISGITLAB}"
only:
variables:
- $AWS == 'true'
artifacts:
when: always
paths:
- $INTEGRATION_TEST_DIR
expire_in: 14 days
adal==1.2.2
boto3==1.14.40
botocore==1.17.54
certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
cryptography==2.8
docutils==0.15.2
idna==2.9
jmespath==0.10.0
pycparser==2.20
PyJWT==1.7.1
python-dateutil==2.8.1
requests==2.23.0
s3transfer==0.3.3
six==1.14.0
urllib3==1.25.8
xmlrunner==1.7.7
\ No newline at end of file
import os;
import boto3;
import jwt;
def get_id_token():
client = boto3.client('cognito-idp', region_name=os.environ["AWS_REGION"])
userAuth = client.initiate_auth(
ClientId= os.environ['AWS_COGNITO_CLIENT_ID'],
AuthFlow= os.environ['AWS_COGNITO_AUTH_FLOW'],
AuthParameters= {
"USERNAME": os.environ['AWS_COGNITO_AUTH_PARAMS_USER'],
"PASSWORD": os.environ['AWS_COGNITO_AUTH_PARAMS_PASSWORD']
})
print(userAuth['AuthenticationResult']['AccessToken'])
def get_invalid_token():
#generate a dummy jwt
return jwt.encode({'some': 'payload'}, 'secret', algorithm='HS256').decode("utf-8")
if __name__ == '__main__':
get_id_token()
Supports Markdown
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