tangled
alpha
login
or
join now
tangled.org
/
knot-docker
89
fork
atom
Community maintained Docker config for the knot server
89
fork
atom
overview
issues
3
pulls
1
pipelines
Update publish.yml
knotbin.com
6 months ago
08cb767c
162b8cf9
0/1
publish.yml
failed
2s
+23
-5
1 changed file
expand all
collapse all
unified
split
.tangled
workflows
publish.yml
+23
-5
.tangled/workflows/publish.yml
···
140
140
EOF
141
141
cp ~/.config/containers/policy.json /etc/containers/policy.json 2>/dev/null || true
142
142
143
143
+
# Debug: Check what images buildah actually created
144
144
+
echo "Debug: Available buildah images:"
145
145
+
buildah images
146
146
+
143
147
# Debug: Check credentials are set
144
148
echo "Debug: DOCKER_USERNAME is set: $([ -n "$DOCKER_USERNAME" ] && echo "YES" || echo "NO")"
145
149
echo "Debug: DOCKER_PASSWORD is set: $([ -n "$DOCKER_PASSWORD" ] && echo "YES" || echo "NO")"
146
150
echo "Debug: DOCKER_USERNAME value: $DOCKER_USERNAME"
147
151
echo "Debug: Password length: ${#DOCKER_PASSWORD}"
148
152
149
149
-
# Export buildah image to docker format
153
153
+
# Export buildah image to docker format with error checking
150
154
echo "Exporting $TAG image..."
151
151
-
buildah push localhost/$DOCKER_USERNAME/$DOCKER_REPO:$TAG docker-archive:image-$TAG.tar
155
155
+
if ! buildah push localhost/$DOCKER_USERNAME/$DOCKER_REPO:$TAG docker-archive:image-$TAG.tar; then
156
156
+
echo "Failed with localhost prefix, trying without..."
157
157
+
if ! buildah push $DOCKER_USERNAME/$DOCKER_REPO:$TAG docker-archive:image-$TAG.tar; then
158
158
+
echo "Both image export attempts failed, listing available images:"
159
159
+
buildah images
160
160
+
exit 1
161
161
+
fi
162
162
+
fi
163
163
+
152
164
echo "Exporting latest image..."
153
153
-
buildah push localhost/$DOCKER_USERNAME/$DOCKER_REPO:latest docker-archive:image-latest.tar
165
165
+
if ! buildah push localhost/$DOCKER_USERNAME/$DOCKER_REPO:latest docker-archive:image-latest.tar; then
166
166
+
echo "Failed with localhost prefix, trying without..."
167
167
+
if ! buildah push $DOCKER_USERNAME/$DOCKER_REPO:latest docker-archive:image-latest.tar; then
168
168
+
echo "Both latest export attempts failed"
169
169
+
exit 1
170
170
+
fi
171
171
+
fi
154
172
155
173
# Check if archives were created
156
174
echo "Debug: Checking created archives..."
157
157
-
ls -la image-*.tar
175
175
+
ls -la image-*.tar 2>/dev/null || echo "No archive files found"
158
176
echo "Debug: Archive sizes:"
159
159
-
du -h image-*.tar
177
177
+
du -h image-*.tar 2>/dev/null || echo "No archive files to measure"
160
178
161
179
# Use skopeo to push to Docker Hub with proper login
162
180
echo "Logging in to Docker Hub..."