Skip to content
Snippets Groups Projects
Commit abdf391b authored by Seraphine Young's avatar Seraphine Young
Browse files

Merge branch 'CE-To-Premium-Section-Name' into 'main'

Reverts section title & Replaces CI file

* Fixes indentation

* replaces CI file to Build and Test for Workshop

* Reverts section title to former name

See merge request gitlab-learn-labs/sample-projects/tanuki-racing!182
parents 53b6ac0a a3fd1963
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,53 @@ This challenge will walk through the steps of importing your CI/CD pipeline proj
1. You should have project already imported into your group, let's take a look at the **_gitlab-ci.yml_** file. On the left sidebar menu click on **Code > Repository > .gitlab-ci.yml** file.
1. Notice that we have a simple pipeline already defined and it has 2 stages **_build & test_** 🛠️. The **_build_** job uses the **_before_script , script, & after_script_** keywords.
1. To begin, open your **.gitlab-ci.yml** file and replace its entire contents with the code shown below:
```yaml
image: docker:latest
services:
- docker:dind
variables:
CS_DEFAULT_BRANCH_IMAGE: $CI_REGISTRY_IMAGE/$CI_DEFAULT_BRANCH:$CI_COMMIT_SHA
DOCKER_DRIVER: overlay2
ROLLOUT_RESOURCE_TYPE: deployment
DOCKER_TLS_CERTDIR: "" # https://gitlab.com/gitlab-org/gitlab-runner/issues/4501
RUNNER_GENERATE_ARTIFACTS_METADATA: "true"
stages:
- build
- test
build:
stage: build
variables:
IMAGE: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA
before_script:
- docker info
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker build -t $IMAGE .
after_script:
- docker push $IMAGE
test:
stage: test
image: gliderlabs/herokuish:latest
script:
- cp -R . /tmp/app
- /bin/herokuish buildpack test
rules:
- if: '$TEST_DISABLED'
when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
allow_failure: true
```
1. Take a moment to review the code, You should now see that it defines two stages, and each stage contains one job 🛠️. The **_build_** job uses the **_before_script , script, & after_script_** keywords.
1. In the **_test_** job we want to use the **_after_script_** keyword to echo out that the test has completed. To do this, we'll be using the pipeline editor. Using the left-hand navigation menu click on **Build > Pipeline editor**. Next, add an **after_script** to the end of the **_test job_**.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment