Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
Step Runner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab.org
Step Runner
Commits
8bc90a06
Commit
8bc90a06
authored
1 year ago
by
Joe Burnett
Browse files
Options
Downloads
Patches
Plain Diff
Pipeline with test, build, e2e and deploy
parent
f493b62e
No related branches found
No related tags found
No related merge requests found
Pipeline
#1092891060
passed
1 year ago
Stage: test
Stage: build
Stage: e2e
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
.gitlab-ci.yml
+61
-0
61 additions, 0 deletions
.gitlab-ci.yml
Dockerfile
+12
-0
12 additions, 0 deletions
Dockerfile
with
74 additions
and
0 deletions
.gitignore
+
1
−
0
View file @
8bc90a06
.local/
step-results.json
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
0 → 100644
+
61
−
0
View file @
8bc90a06
variables
:
IMAGE_TAG
:
$CI_REGISTRY_IMAGE:pipeline-$CI_PIPELINE_ID
stages
:
-
test
-
build
-
e2e
-
deploy
go-test
:
stage
:
test
image
:
golang:1.21
script
:
-
go test ./...
docker-build
:
stage
:
build
image
:
docker:20.10.16
services
:
-
docker:20.10.16-dind
script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker build -t $IMAGE_TAG .
-
docker push $IMAGE_TAG
run-e2e
:
stage
:
e2e
image
:
$IMAGE_TAG
script
:
-
/step-runner ci
variables
:
STEPS
:
|
type: steps
steps:
- name: hello-world
step: https+git://gitlab.com/gitlab-org/ci-cd/runner-tools/step-runner-e2e-test-project
inputs:
echo: ${CI_PIPELINE_ID}
artifacts
:
paths
:
-
step-results.json
verify-e2e
:
stage
:
e2e
needs
:
[
"
run-e2e"
]
script
:
-
apt update && apt install -y jq
-
if [[ $(jq -r '.children_step_results[0].outputs.echo' step-results.json) != $CI_PIPELINE_ID ]]; then exit 1 ; fi
docker-push
:
stage
:
deploy
rules
:
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
image
:
docker:20.10.16
services
:
-
docker:20.10.16-dind
script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker pull $IMAGE_TAG
-
docker tag $IMAGE_TAG $CI_REGISTRY_IMAGE:v0
-
docker push $CI_REGISTRY_IMAGE:v0
This diff is collapsed.
Click to expand it.
Dockerfile
0 → 100644
+
12
−
0
View file @
8bc90a06
FROM
golang:1.21
WORKDIR
/app
COPY
go.mod go.sum ./
RUN
go mod download
COPY
. ./
RUN
CGO_ENABLED
=
0
GOOS
=
linux go build
-o
/step-runner
CMD
["/step-runner"]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment