Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rust Android CI
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Infrastructure Components
Rust Android CI
Commits
b30c0a97
Commit
b30c0a97
authored
1 month ago
by
Louis
Browse files
Options
Downloads
Patches
Plain Diff
Add gitlab CI config
parent
b9e8d74e
No related branches found
No related tags found
No related merge requests found
Pipeline
#733
passed with stage
in 9 minutes and 6 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+36
-0
36 additions, 0 deletions
.gitlab-ci.yml
Dockerfile
+2
-0
2 additions, 0 deletions
Dockerfile
with
38 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
36
−
0
View file @
b30c0a97
# GitLab CI configuration for building and publishing Docker images
stages
:
-
build
variables
:
# Docker image name based on the GitLab project path
IMAGE_NAME
:
${CI_REGISTRY_IMAGE}
# Use Docker BuildKit for better performance
DOCKER_BUILDKIT
:
1
# Build arguments
DOCKER_BUILD_ARGS
:
"
"
# Build and publish Docker image when a tag is pushed
build-and-publish
:
stage
:
build
image
:
docker:latest
services
:
-
docker:dind
# Only run this job when a tag is pushed
rules
:
-
if
:
$CI_COMMIT_TAG
before_script
:
# Log in to the GitLab Container Registry
-
echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
script
:
# Build the Docker image with the tag as version
-
docker build --pull ${DOCKER_BUILD_ARGS} -t ${IMAGE_NAME}:${CI_COMMIT_TAG} .
# Push the versioned tag
-
docker push ${IMAGE_NAME}:${CI_COMMIT_TAG}
-
echo "Docker image '${IMAGE_NAME}:${CI_COMMIT_TAG}' was built and pushed to the registry"
# Cache Docker layers between jobs
cache
:
key
:
${CI_COMMIT_REF_SLUG}
paths
:
-
.docker-cache/
This diff is collapsed.
Click to expand it.
Dockerfile
+
2
−
0
View file @
b30c0a97
# Use cimg/android:2025.04-ndk as the base image
FROM
cimg/android:2025.04-ndk
USER
root
# Set environment variables
ENV
RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
...
...
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