Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Cozy Stack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
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
web-et-numerique
Factory
LLLE_Project
Cozy Stack
Commits
d07cdd92
Unverified
Commit
d07cdd92
authored
5 years ago
by
Bruno Michel
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix self-hosted release with go modules (#1989)
parent
1c915b84
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docs/docker.md
+2
-1
2 additions, 1 deletion
docs/docker.md
scripts/Dockerfile
+13
-7
13 additions, 7 deletions
scripts/Dockerfile
scripts/build.sh
+1
-2
1 addition, 2 deletions
scripts/build.sh
scripts/release.sh
+0
-2
0 additions, 2 deletions
scripts/release.sh
with
16 additions
and
12 deletions
docs/docker.md
+
2
−
1
View file @
d07cdd92
...
@@ -33,7 +33,8 @@ adapt to your own system.
...
@@ -33,7 +33,8 @@ adapt to your own system.
```
bash
```
bash
# From your cozy-stack developement folder
# From your cozy-stack developement folder
docker run
-it
--rm
--name
cozy-stack
\
docker run
-it
--rm
--name
cozy-stack
\
-v
$(
pwd
)
:/go/src/github.com/cozy/cozy-stack
\
--workdir
/app
\
-v
$(
pwd
)
:/app
\
-v
$(
pwd
)
:/go/bin
\
-v
$(
pwd
)
:/go/bin
\
golang:1.12
\
golang:1.12
\
go get
-v
github.com/cozy/cozy-stack
go get
-v
github.com/cozy/cozy-stack
...
...
This diff is collapsed.
Click to expand it.
scripts/Dockerfile
+
13
−
7
View file @
d07cdd92
...
@@ -3,9 +3,9 @@
...
@@ -3,9 +3,9 @@
# It should not be used for hosting your cozy cloud in production.
# It should not be used for hosting your cozy cloud in production.
# Multi-stage image: this step builds cozy-stack
# Multi-stage image: this step builds cozy-stack
(and mailhog)
FROM
golang:1.12
as
build
FROM
golang:1.12
as
build
WORKDIR
/
go/src/github.com/cozy/cozy-stack
WORKDIR
/
app
# MailHog
# MailHog
ENV
MAILHOG_SRC_URL=https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64 \
ENV
MAILHOG_SRC_URL=https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64 \
...
@@ -14,9 +14,15 @@ RUN set -eu; curl -fsSL "$MAILHOG_SRC_URL" -o MailHog \
...
@@ -14,9 +14,15 @@ RUN set -eu; curl -fsSL "$MAILHOG_SRC_URL" -o MailHog \
&&
echo
"
$MAILHOG_SRC_SHA256
MailHog"
|
sha256sum
-c
-
\
&&
echo
"
$MAILHOG_SRC_SHA256
MailHog"
|
sha256sum
-c
-
\
&&
chmod
+x MailHog
&&
chmod
+x MailHog
# Use docker layer caching to avoid redownloading go modules if the code has
# changed but not the dependencies.
COPY
go.mod .
COPY
go.sum .
RUN
go mod download
# Build cozy-stack
# Build cozy-stack
COPY
. .
COPY
. .
RUN
go get
-d
-v
./...
&&
./scripts/build.sh dev
RUN
./scripts/build.sh dev
# Multi-stage image: the main image
# Multi-stage image: the main image
...
@@ -73,10 +79,10 @@ RUN set -eux; apt-get update \
...
@@ -73,10 +79,10 @@ RUN set -eux; apt-get update \
COPY
--from=build \
COPY
--from=build \
/
go/src/github.com/cozy/cozy-stack
/cozy-stack \
/
app
/cozy-stack \
/
go/src/github.com/cozy/cozy-stack
/scripts/docker-entrypoint.sh \
/
app
/scripts/docker-entrypoint.sh \
/
go/src/github.com/cozy/cozy-stack
/scripts/cozy-app-dev.sh \
/
app
/scripts/cozy-app-dev.sh \
/
go/src/github.com/cozy/cozy-stack
/MailHog \
/
app
/MailHog \
/usr/bin/
/usr/bin/
EXPOSE
8080 6060 8025 5984
EXPOSE
8080 6060 8025 5984
...
...
This diff is collapsed.
Click to expand it.
scripts/build.sh
+
1
−
2
View file @
d07cdd92
...
@@ -95,8 +95,7 @@ do_build() {
...
@@ -95,8 +95,7 @@ do_build() {
go build
-ldflags
"
\
go build
-ldflags
"
\
-X github.com/cozy/cozy-stack/pkg/config.Version=
${
VERSION_STRING
}
\
-X github.com/cozy/cozy-stack/pkg/config.Version=
${
VERSION_STRING
}
\
-X github.com/cozy/cozy-stack/pkg/config.BuildTime=
${
BUILD_TIME
}
\
-X github.com/cozy/cozy-stack/pkg/config.BuildTime=
${
BUILD_TIME
}
\
-X github.com/cozy/cozy-stack/pkg/config.BuildMode=
${
BUILD_MODE
}
-X github.com/cozy/cozy-stack/pkg/config.BuildMode=
${
BUILD_MODE
}
"
\
"
\
-o
"
${
BINARY
}
"
-o
"
${
BINARY
}
"
popd
>
/dev/null
popd
>
/dev/null
echo
"ok"
echo
"ok"
...
...
This diff is collapsed.
Click to expand it.
scripts/release.sh
+
0
−
2
View file @
d07cdd92
...
@@ -3,8 +3,6 @@ set -xe
...
@@ -3,8 +3,6 @@ set -xe
RELEASE
=
"
$(
git describe
--tags
)
"
RELEASE
=
"
$(
git describe
--tags
)
"
go get
-u
-v
./...
||
true
# Always fail if you are in a tag…
docker build
-t
"cozy/cozy-app-dev:
${
RELEASE
}
"
-f
scripts/Dockerfile
.
docker build
-t
"cozy/cozy-app-dev:
${
RELEASE
}
"
-f
scripts/Dockerfile
.
docker push
"cozy/cozy-app-dev:
${
RELEASE
}
"
docker push
"cozy/cozy-app-dev:
${
RELEASE
}
"
docker tag
"cozy/cozy-app-dev:
${
RELEASE
}
"
"cozy/cozy-app-dev:latest"
docker tag
"cozy/cozy-app-dev:
${
RELEASE
}
"
"cozy/cozy-app-dev:latest"
...
...
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