Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Web Hosting EKS - PHP 8.4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OTDI Web Hosting
Container Images
Web Hosting EKS - PHP 8.4
Commits
f8e10bf1
Commit
f8e10bf1
authored
1 year ago
by
Edward Hicks
Browse files
Options
Downloads
Patches
Plain Diff
convert (again) to kaniko builder
parent
c5cffaae
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+44
-26
44 additions, 26 deletions
.gitlab-ci.yml
with
44 additions
and
26 deletions
.gitlab-ci.yml
+
44
−
26
View file @
f8e10bf1
variables
:
DOCKER_DRIVER
:
overlay2
DOCKER_TLS_CERTDIR
:
"
"
DOCKER_TLS_VERIFY
:
"
"
DOCKER_BUILDKIT
:
0
stages
:
-
awsauth
-
build
-
test
awsauth
:
stage
:
awsauth
...
...
@@ -20,29 +15,52 @@ awsauth:
build
:
stage
:
build
image
:
registry.containers.it.osu.edu/cache-docker/library/docker:20
tags
:
-
webhosting
-
kaniko
image
:
name
:
gcr.io/kaniko-project/executor:v1.12.1-debug
entrypoint
:
[
"
"
]
variables
:
TAG
:
"
$CI_COMMIT_REF_SLUG"
needs
:
-
job
:
awsauth
artifacts
:
true
services
:
-
name
:
docker:20-dind
command
:
[
"
--experimental"
]
variables
:
IMAGE
:
"
$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
script
:
-
docker info
-
echo "$CI_REGISTRY_PASSWORD" | docker login --username "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
-
echo "$AWS_ECR_TOKEN" | docker login --username "AWS" --password-stdin $AWS_ECR_REGISTRY
-
docker build --squash --tag $IMAGE .
-
docker push $IMAGE
-
if [ $CI_COMMIT_REF_SLUG = "master" -o $CI_COMMIT_REF_SLUG = "main" ]; then TAG="latest"; fi
-
echo "CS_IMAGE=${CI_REGISTRY_IMAGE}:${TAG}" >> build.env
-
|
echo "
{
\"auths\" : {
\"${CI_REGISTRY}\" : {
\"auth\" : \"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"
},
\"${AWS_ECR_REGISTRY}\" : {
\"auth\" : \"$(printf "%s:%s" "AWS" "${AWS_ECR_TOKEN}" | base64 | tr -d '\n')\"
},
\"$CI_DEPENDENCY_PROXY_SERVER\":{
\"auth\":\"$(printf "%s:%s" ${CI_DEPENDENCY_PROXY_USER} "${CI_DEPENDENCY_PROXY_PASSWORD}" | base64 | tr -d '\n')\"
}
}
}
" > /kaniko/.docker/config.json
-
|
if [ $CI_COMMIT_REF_SLUG == "master" ]; then
TAG="latest"
else
TAG="$CI_COMMIT_REF_SLUG"
fi
-
docker tag $IMAGE $CI_REGISTRY_IMAGE:$TAG
-
docker push $CI_REGISTRY_IMAGE:$TAG
-
docker tag $IMAGE $AWS_ECR_REGISTRY/$CI_PROJECT_NAME:$TAG
-
docker push $AWS_ECR_REGISTRY/$CI_PROJECT_NAME:$TAG
/kaniko/executor \
--context "${CI_PROJECT_DIR}" \
--dockerfile "${CI_PROJECT_DIR}/Dockerfile" \
--destination "${CI_REGISTRY_IMAGE}:${TAG}" \
--destination "${AWS_ECR_REGISTRY}/${CI_PROJECT_NAME}:${TAG}" \
--git "branch=${CI_COMMIT_REF_SLUG},depth=1,single-branch=true,recurse-submodules=true,shallow-submodules=true" \
--single-snapshot
retry
:
2
artifacts
:
reports
:
dotenv
:
build.env
container_scanning
:
dependencies
:
-
build
include
:
-
template
:
Security/Container-Scanning.gitlab-ci.yml
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