Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
docker-baseimage-ubuntu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
JetBrains YouTrack
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
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
Prosper
docker-baseimage-ubuntu
Commits
c8e4856d
Commit
c8e4856d
authored
3 years ago
by
Griefed
Browse files
Options
Downloads
Patches
Plain Diff
I'm stupid
parent
acc34e92
No related branches found
Tags
72faae4f-ls12
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+13
-15
13 additions, 15 deletions
.gitlab-ci.yml
with
13 additions
and
15 deletions
.gitlab-ci.yml
+
13
−
15
View file @
c8e4856d
...
@@ -179,6 +179,7 @@ Check Packages:on-schedule:
...
@@ -179,6 +179,7 @@ Check Packages:on-schedule:
docker image rm -f $DOCKERHUB_USER/$DOCKERHUB_REPO:latest
docker image rm -f $DOCKERHUB_USER/$DOCKERHUB_REPO:latest
docker image rm -f localbuild
docker image rm -f localbuild
rm -rf /tmp/$CI_PROJECT_PATH
rm -rf /tmp/$CI_PROJECT_PATH
rm -f /tmp/package_versions*
mkdir -p /tmp/$CI_PROJECT_PATH
mkdir -p /tmp/$CI_PROJECT_PATH
script
:
script
:
-
|-
-
|-
...
@@ -190,24 +191,22 @@ Check Packages:on-schedule:
...
@@ -190,24 +191,22 @@ Check Packages:on-schedule:
docker build --tag localbuild . && \
docker build --tag localbuild . && \
# Get packages from newly build local image
# Get packages from newly build local image
docker run --rm --entrypoint /bin/sh -v /tmp
/$CI_PROJECT_PATH:/tmp/$CI_PROJECT_PATH
localbuild -c '\
docker run --rm --entrypoint /bin/sh -v /tmp
:/tmp
localbuild -c '\
apt list -qq --installed > /tmp/
$CI_PROJECT_PATH/
package_versions_new.txt && \
apt list -qq --installed > /tmp/package_versions_new.txt && \
sort -o /tmp/
$CI_PROJECT_PATH/
package_versions_new.txt /tmp/
$CI_PROJECT_PATH/
package_versions_new.txt && \
sort -o /tmp/package_versions_new.txt /tmp/package_versions_new.txt && \
chmod 777 /tmp/
$CI_PROJECT_PATH/
package_versions_new.txt' && \
chmod 777 /tmp/package_versions_new.txt' && \
# Gather package information from latest build
# Gather package information from latest build
docker run --rm --entrypoint /bin/sh -v /tmp/$CI_PROJECT_PATH:/tmp/$CI_PROJECT_PATH $DOCKERHUB_USER/$DOCKERHUB_REPO:latest -c '\
docker run --rm --entrypoint /bin/sh -v /tmp:/tmp $DOCKERHUB_USER/$DOCKERHUB_REPO:latest -c '\
apt list -qq --installed > /tmp/$CI_PROJECT_PATH/package_versions_old.txt && \
apt list -qq --installed > /tmp/package_versions_old.txt && \
sort -o /tmp/$CI_PROJECT_PATH/package_versions_old.txt /tmp/$CI_PROJECT_PATH/package_versions_old.txt && \
sort -o /tmp/package_versions_old.txt /tmp/package_versions_old.txt && \
chmod 777 /tmp/$CI_PROJECT_PATH/package_versions_old.txt' && \
chmod 777 /tmp/package_versions_old.txt' && \
ls -ahl /tmp/$CI_PROJECT_PATH && \
# Get checksum of old packages
# Get checksum of old packages
OLD_CHECKSUM=$(md5sum /tmp/
$CI_PROJECT_PATH/
package_versions_old.txt | cut -f1 -d" ") && \
OLD_CHECKSUM=$(md5sum /tmp/package_versions_old.txt | cut -f1 -d" ") && \
# Get checksum of new packages
# Get checksum of new packages
NEW_CHECKSUM=$(md5sum /tmp/
$CI_PROJECT_PATH/
package_versions_new.txt | cut -f1 -d" ") && \
NEW_CHECKSUM=$(md5sum /tmp/package_versions_new.txt | cut -f1 -d" ") && \
# If new checksum is not the same as old checksum, we have new versions
# If new checksum is not the same as old checksum, we have new versions
if [ "${OLD_CHECKSUM}" != "${NEW_CHECKSUM}" ]; then
if [ "${OLD_CHECKSUM}" != "${NEW_CHECKSUM}" ]; then
...
@@ -216,13 +215,12 @@ Check Packages:on-schedule:
...
@@ -216,13 +215,12 @@ Check Packages:on-schedule:
git --git-dir /tmp/$CI_PROJECT_PATH.git checkout -f master && \
git --git-dir /tmp/$CI_PROJECT_PATH.git checkout -f master && \
# Copy the new package versions list to repository
# Copy the new package versions list to repository
cp -f /tmp/$CI_PROJECT_PATH/package_versions_new.txt /tmp/$CI_PROJECT_PATH/package_versions.txt && \
cp -f /tmp/package_versions_new.txt /tmp/$CI_PROJECT_PATH/package_versions.txt && \
rm -f /tmp/$CI_PROJECT_PATH/package_versions_new.txt /tmp/$CI_PROJECT_PATH/package_versions_old.txt && \
wait && \
wait && \
# Add and commit new file to repository
# Add and commit new file to repository
git add
/tmp/$CI_PROJECT_PATH/
package_versions.txt && \
git add package_versions.txt && \
git commit -m 'build: Update installed packages.' && \
git commit -m 'build: Update installed packages.' && \
# Push the changes to the remote
# Push the changes to the remote
...
...
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