diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..254a5061113f0f8256e7c40daddb9abe4e1ff3d7 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,51 @@ +image: gitlab.rc.uab.edu:4567/rc/packer-openstack-hpc-image:latest + +variables: + ANSIBLE_REMOTE_TMP: "/tmp" + OS_REGION_NAME: "bhm1" + OS_INTERFACE: "public" + OS_IDENTITY_API_VERSION: "3" + OS_AUTH_TYPE: "v3applicationcredential" + OS_AUTH_URL: "https://keystone.cloud.rc.uab.edu:5000/v3" + PKR_VAR_external_net: "fe323451-86c9-43c0-b46f-33f3f3f6ce14" + PKR_VAR_internal_net: "166527dd-5f67-4577-ade9-f0b84677aaa7" + PKR_VAR_instance_floating_ip_net: "acc19436-59c4-4bce-a4ab-a115be45ceb9" + PKR_VAR_build_instance_name: "ohpc" + PKR_VAR_build_image_name: "xdmod" + PKR_VAR_ssh_username: "centos" + PKR_VAR_ssh_keypair_name: "dev" + PKR_VAR_flavor: "m1.medium" + PKR_VAR_source_image_name: "CentOS-7-x86_64-GenericCloud-1905" + GIT_SUBMODULE_STRATEGY: recursive + +stages: # List of stages for jobs, and their order of execution + - build + - test + - deploy + +build_packer: + stage: build + tags: [build] + script: + - terraform --version + +unit-test-job: # This job runs in the test stage. + stage: test # It only starts when the job in the build stage completes successfully. + script: + - echo "Running unit tests... This will take about 60 seconds." + - sleep 60 + - echo "Code coverage is 90%" + +lint-test-job: # This job also runs in the test stage. + stage: test # It can run at the same time as unit-test-job (in parallel). + script: + - echo "Linting code... This will take about 10 seconds." + - sleep 10 + - echo "No lint issues found." + +deploy-job: # This job runs in the deploy stage. + stage: deploy # It only runs when *both* jobs in the test stage complete successfully. + environment: production + script: + - echo "Deploying application..." + - echo "Application successfully deployed."