Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Testsuite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Feneas
federation
Testsuite
Commits
cfa553b4
Commit
cfa553b4
authored
Sep 17, 2019
by
zauberstuhl
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'move-to-feneas-registry' into 'master'
Move to feneas registry Closes
#6
See merge request
!15
parents
d22f82f2
046787a1
Pipeline
#2345
canceled with stage
in 12 minutes and 15 seconds
Changes
6
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
101 deletions
+21
-101
docs/index.md
docs/index.md
+2
-2
projects/mastodon/Dockerfile
projects/mastodon/Dockerfile
+3
-80
projects/mastodon/start.sh
projects/mastodon/start.sh
+3
-3
projects/socialhome/Dockerfile
projects/socialhome/Dockerfile
+4
-8
scripts/build_docker_image.sh
scripts/build_docker_image.sh
+6
-6
test_helper.bash
test_helper.bash
+3
-2
No files found.
docs/index.md
View file @
cfa553b4
...
...
@@ -156,9 +156,9 @@ fi
Last final step before we have a fully functional docker image is to build the actual image:
docker build --no-cache -t
feneas/testsuite_
testproject:v1.0.3-testproject .
docker build --no-cache -t
registry.git.feneas.org/feneas/federation/testsuite/
testproject:v1.0.3-testproject .
The testsuite requires a special naming for every image:
`
feneas/testsuite_
<project>:<version>-<project>`
The testsuite requires a special naming for every image:
`
registry.git.feneas.org/feneas/federation/testsuite/
<project>:<version>-<project>`
If we succesfully build the docker image we have to commit our changes
and create a project tag and we are done with the image part:
...
...
projects/mastodon/Dockerfile
View file @
cfa553b4
FROM
node:8.11.3-alpine as node
FROM
ruby:2.4.4-alpine3.6
LABEL
maintainer="https://github.com/tootsuite/mastodon" \
description="Your self-hosted, globally interconnected microblogging community"
ARG
UID=991
ARG
GID=991
ENV
PATH=/mastodon/bin:$PATH \
RAILS_SERVE_STATIC_FILES=true \
RAILS_ENV=production \
NODE_ENV=production
ARG
LIBICONV_VERSION=1.15
ARG
LIBICONV_DOWNLOAD_SHA256=ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178
EXPOSE
3000 4000
WORKDIR
/mastodon
COPY
--from=node /usr/local/bin/node /usr/local/bin/node
COPY
--from=node /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY
--from=node /usr/local/bin/npm /usr/local/bin/npm
COPY
--from=node /opt/yarn-* /opt/yarn
RUN
apk
-U
upgrade
\
&&
apk add
-t
build-dependencies
\
build-base
\
icu-dev
\
libidn-dev
\
libressl
\
libtool
\
postgresql-dev
\
protobuf-dev
\
python
\
&&
apk add
\
ca-certificates
\
ffmpeg
\
file
\
git
\
icu-libs
\
imagemagick
\
libidn
\
libpq
\
protobuf
\
tini
\
tzdata
\
&&
update-ca-certificates
\
&&
ln
-s
/opt/yarn/bin/yarn /usr/local/bin/yarn
\
&&
ln
-s
/opt/yarn/bin/yarnpkg /usr/local/bin/yarnpkg
\
&&
mkdir
-p
/tmp/src /opt
\
&&
wget
-O
libiconv.tar.gz
"https://ftp.gnu.org/pub/gnu/libiconv/libiconv-
$LIBICONV_VERSION
.tar.gz"
\
&&
echo
"
$LIBICONV_DOWNLOAD_SHA256
*libiconv.tar.gz"
|
sha256sum
-c
-
\
&&
tar
-xzf
libiconv.tar.gz
-C
/tmp/src
\
&&
rm
libiconv.tar.gz
\
&&
cd
/tmp/src/libiconv-
$LIBICONV_VERSION
\
&&
./configure
--prefix
=
/usr/local
\
&&
make
-j
$(
getconf _NPROCESSORS_ONLN
)
\
&&
make
install
\
&&
libtool
--finish
/usr/local/lib
\
&&
cd
/mastodon
\
&&
rm
-rf
/tmp/
*
/var/cache/apk/
*
RUN
addgroup
-g
${
GID
}
mastodon
&&
adduser
-h
/mastodon
-s
/bin/sh
-D
-G
mastodon
-u
${
UID
}
mastodon
#COPY Gemfile Gemfile.lock package.json yarn.lock .yarnclean /mastodon/
RUN
git clone
--depth
1 https://github.com/tootsuite/mastodon.git /mastodon
RUN
mkdir
-p
/mastodon/public/system /mastodon/public/assets /mastodon/public/packs
RUN
chown
-R
mastodon:mastodon /mastodon
RUN
bundle config build.nokogiri
--with-iconv-lib
=
/usr/local/lib
--with-iconv-include
=
/usr/local/include
\
&&
bundle
install
-j
$(
getconf _NPROCESSORS_ONLN
)
--deployment
--without
test
development
\
&&
yarn
install
--pure-lockfile
--ignore-engines
\
&&
yarn cache clean
VOLUME
/mastodon/public/system
FROM
tootsuite/mastodon:v2.8.2
USER
root
# XXX workaround for ruby goldfinger gem
# adds the ability to search profiles via http
# (see https://github.com/tootsuite/goldfinger/pull/2)
RUN
sed
-i
's/https/http/'
$(
bundle show goldfinger
)
/lib/goldfinger/client.rb
USER
mastodon
RUN
OTP_SECRET
=
precompile_placeholder
SECRET_KEY_BASE
=
precompile_placeholder bundle
exec
rails assets:precompile
# XXX disable redis; redis received all jobs but
# didn't execute them. bypassing it now till
# someone with more knowledge comes around
...
...
@@ -92,7 +15,7 @@ RUN echo -e "if Rails.env.development?\n"\
"Sidekiq::Testing.inline!
\n
"
\
"end"
>>
config/initializers/sidekiq.rb
COPY
.env /mastodon/.env
COPY
.env /
opt/
mastodon/.env
COPY
start.sh /start.sh
CMD
["/bin/bash", "/start.sh"]
projects/mastodon/start.sh
View file @
cfa553b4
...
...
@@ -2,9 +2,9 @@
WEBPACK_PORT
=
$((
$PORT
+
100
))
sed
-i
"s/APP_PORT/
$PORT
/"
/mastodon/
.env
sed
-i
"s/DATABASE_NAME/
$DATABASE
/"
/mastodon/
.env
sed
-i
"s/LOCALHOST/
$(
hostname
-i
)
/"
/mastodon/
.env
sed
-i
"s/APP_PORT/
$PORT
/"
.env
sed
-i
"s/DATABASE_NAME/
$DATABASE
/"
.env
sed
-i
"s/LOCALHOST/
$(
hostname
-i
)
/"
.env
sed
-i
"s/port: 3035/port:
$WEBPACK_PORT
/"
config/webpacker.yml
./bin/webpack-dev-server
--port
$WEBPACK_PORT
&
...
...
projects/socialhome/Dockerfile
View file @
cfa553b4
FROM
python:3
RUN
apt-get update
RUN
apt-get
install
-y
git-core
RUN
apt-get
install
-y
git-core
npm
RUN
git clone https://github.com/jaywink/socialhome.git
WORKDIR
/socialhome
RUN
bash install_ubuntu_dependencies.sh
install
RUN
curl
-sL
https://deb.nodesource.com/setup_8.x | bash -
RUN
apt-get
install
-y
nodejs
RUN
pip
install
-U
pip
setuptools
==
30.4 pip-tools
RUN
pip
install
-U
pip setuptools pip-tools
RUN
pip-sync dev-requirements.txt
RUN
npm
install
RUN
npm
install
-g
bower
RUN
bower
install
--allow-root
RUN
npm
-g
install
grunt
RUN
cd
socialhome/frontend
&&
npm
install
&&
cd
-
RUN
npm
install
-g
bower
&&
bower
install
--allow-root
RUN
npm run build
COPY
.env /socialhome/.env
...
...
scripts/build_docker_image.sh
View file @
cfa553b4
...
...
@@ -6,14 +6,14 @@ project=$(echo $CI_COMMIT_TAG |cut -d- -f2)
cd
$CI_PROJECT_DIR
/projects/
$project
||
exit
1
# authenticate with docker registry first
docker login
-u
$
DOCKER_USER
-p
$DOCKER_PASSWORD
||
exit
1
docker login
-u
$
CI_REGISTRY_USER
-p
$CI_REGISTRY_PASSWORD
$CI_REGISTRY
||
exit
1
# build the image locally
docker build
-t
\
feneas/testsuite_
${
project
}
:
$CI_COMMIT_TAG
.
||
exit
1
${
CI_REGISTRY_IMAGE
}
/
${
project
}
:
$CI_COMMIT_TAG
.
||
exit
1
# overwrite latest-tag with new image
docker tag
feneas/testsuite_
${
project
}
:
$CI_COMMIT_TAG
\
feneas/testsuite_
${
project
}
:latest
||
exit
1
docker tag
${
CI_REGISTRY_IMAGE
}
/
${
project
}
:
$CI_COMMIT_TAG
\
${
CI_REGISTRY_IMAGE
}
/
${
project
}
:latest
||
exit
1
# upload the image and both tags
docker push
feneas/testsuite_
${
project
}
:
$CI_COMMIT_TAG
||
exit
1
docker push
feneas/testsuite_
${
project
}
:latest
||
exit
1
docker push
${
CI_REGISTRY_IMAGE
}
/
${
project
}
:
$CI_COMMIT_TAG
||
exit
1
docker push
${
CI_REGISTRY_IMAGE
}
/
${
project
}
:latest
||
exit
1
test_helper.bash
View file @
cfa553b4
export
btf
=
$(
basename
$BATS_TEST_FILENAME
)
export
curl_params
=
"/tmp/.bats-curl_params"
export
test_id
=
"/tmp/.bats-test_id"
export
CI_REGISTRY_IMAGE
=
"registry.git.feneas.org/feneas/federation/testsuite"
unset
HTTP_STATUS_CODE
unset
HTTP_BODY
...
...
@@ -82,11 +83,11 @@ function start_app() {
params
=
"-e PROJECT=
$PROJECT
-e PRSHA=
$PRSHA
-e PRREPO=
$PRREPO
"
fi
cid
=
$(
container_id
"
$1
"
)
echo
"Starting docker container
$cid
(
feneas/testsuite_
$3
) on port
$2
"
echo
"Starting docker container
$cid
(
${
CI_REGISTRY_IMAGE
}
/
$3
) on port
$2
"
docker run
--name
=
$cid
$params
\
--link
$(
container_id
"postgres"
)
:postgreshost
\
--link
$(
container_id
"redis"
)
:redishost
\
-e
DATABASE
=
$1
-e
PORT
=
$2
-d
feneas/testsuite_
$3
-e
DATABASE
=
$1
-e
PORT
=
$2
-d
${
CI_REGISTRY_IMAGE
}
/
$3
}
# stop_app "g1"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment