Skip to content

sync 02/05/2019 #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules
git_*
*.tgz
sdk-tmp
package-lock.json
13 changes: 3 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@ RUN groupadd -r wicked --gid=888 && useradd -r -g wicked --uid=888 wicked
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 \
&& chmod +x /usr/local/bin/dumb-init
RUN set -x \
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates wget gosu && rm -rf /var/lib/apt/lists/* \
# verify that the binary works
gosu nobody true

RUN mkdir -p /usr/src/portal-env /usr/src/app && chown -R wicked:wicked /usr/src && \
mkdir -p /home/wicked && chown -R wicked:wicked /home/wicked
Expand Down
20 changes: 10 additions & 10 deletions assemble-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ const fs = require('fs');
const path = require('path');

const dirs = [
'wicked.portal',
'wicked.portal-api',
'wicked.portal-chatbot',
'wicked.portal-env',
'wicked.portal-kong-adapter',
'wicked.portal-mailer',
'wicked.portal-kickstarter',
'wicked.portal-auth',
'wicked.portal-test/portal-api',
'wicked.portal-test/portal-kong-adapter'
'wicked.ui',
'wicked.api',
'wicked.chatbot',
'wicked.env',
'wicked.kong-adapter',
'wicked.mailer',
'wicked.kickstarter',
'wicked.auth',
'wicked.test/portal-api',
'wicked.test/portal-kong-adapter'
];

const baseDir = path.resolve(path.join(__dirname, '..'));
Expand Down
12 changes: 6 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ echo "============================================"
echo "Building normal image..."
echo "============================================"

docker build --pull -t ${DOCKER_PREFIX}portal-env:${DOCKER_TAG}-onbuild --no-cache .
docker build --pull -t ${DOCKER_PREFIX}env:${DOCKER_TAG}-onbuild --no-cache .

echo "============================================"
echo "Building alpine image..."
echo "============================================"

docker build --pull -f Dockerfile-alpine -t ${DOCKER_PREFIX}portal-env:${DOCKER_TAG}-onbuild-alpine --no-cache .
docker build --pull -f Dockerfile-alpine -t ${DOCKER_PREFIX}env:${DOCKER_TAG}-onbuild-alpine --no-cache .

if [ "$1" = "--push" ]; then

Expand All @@ -108,16 +108,16 @@ if [ "$1" = "--push" ]; then
fi

echo "============================================"
echo "Pushing ${DOCKER_PREFIX}portal-env:${DOCKER_TAG}-onbuild"
echo "Pushing ${DOCKER_PREFIX}env:${DOCKER_TAG}-onbuild"
echo "============================================"

docker push ${DOCKER_PREFIX}portal-env:${DOCKER_TAG}-onbuild
docker push ${DOCKER_PREFIX}env:${DOCKER_TAG}-onbuild

echo "============================================"
echo "Pushing ${DOCKER_PREFIX}portal-env:${DOCKER_TAG}-onbuild-alpine"
echo "Pushing ${DOCKER_PREFIX}env:${DOCKER_TAG}-onbuild-alpine"
echo "============================================"

docker push ${DOCKER_PREFIX}portal-env:${DOCKER_TAG}-onbuild-alpine
docker push ${DOCKER_PREFIX}env:${DOCKER_TAG}-onbuild-alpine
else
if [ ! -z "$1" ]; then
echo "WARNING: Unknown parameter '$1'; did you mean --push?"
Expand Down
4 changes: 2 additions & 2 deletions docker-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dockerTools.getMatchingTag = function (namespace, imageName, tagName, callback)
let fallbackTag = null;
if (alpineIndex > 0) {
const baseName = tagName.substring(0, alpineIndex - 1);
if (imageName.indexOf('portal-env') > 0) {
if (imageName.indexOf('env') > 0) {
exactTag = baseName + '-onbuild-alpine';
fallbackTag = 'next-onbuild-alpine';
} else {
Expand All @@ -38,7 +38,7 @@ dockerTools.getMatchingTag = function (namespace, imageName, tagName, callback)
}
} else {
const baseName = tagName;
if (imageName.indexOf('portal-env') > 0) {
if (imageName.indexOf('env') > 0) {
exactTag = baseName + '-onbuild';
fallbackTag = 'next-onbuild';
} else {
Expand Down
31 changes: 16 additions & 15 deletions local-update-portal-env.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

# Use this file after you have made changes to portal-env which you need
# Use this file after you have made changes to env which you need
# to propagate into the different packages. This is done by the build scripts
# automatically via portal-env being the base for all other docker images, but
# automatically via env being the base for all other docker images, but
# if you need to update locally, try this.

echo "==== STARTING ==== $0"
Expand All @@ -28,15 +28,15 @@ pushd ${currentDir} > /dev/null

envVersion=$(cat package.json | jq '.version' | tr -d '"')
if [[ -z "${envVersion}" ]]; then
echo "ERROR: Could not retrieve portal-env version from package.json"
echo "ERROR: Could not retrieve env version from package.json"
exit 1
fi

echo "INFO: Updating portal-env in repositories which needs it."
echo "INFO: portal-env v${envVersion}"
echo "INFO: Updating env in repositories which needs it."
echo "INFO: env v${envVersion}"

packageFile="portal-env-${envVersion}.tgz"
logFile="wicked.portal-env/local-update-portal-env.log"
logFile="wicked.env/local-update-portal-env.log"
rm -f portal-env-*
rm -f ../${packageFile}

Expand All @@ -49,13 +49,13 @@ if [ "$1" = "--copy" ]; then
else
for prefix in "" "wicked."; do
for wickedDir in \
"portal-api" \
"portal" \
"portal-auth" \
"portal-kong-adapter" \
"portal-mailer" \
"portal-chatbot" \
"portal-kickstarter"; do
"api" \
"ui" \
"auth" \
"kong-adapter" \
"mailer" \
"chatbot" \
"kickstarter"; do

if [ -d "../${prefix}${wickedDir}" ]; then
echo "INFO: Updating ${prefix}${wickedDir}"
Expand All @@ -67,8 +67,9 @@ else
done

for wickedDir in \
"wicked.portal-test/portal-api" \
"wicked.portal-test/portal-auth"; do
"wicked.test/portal-api" \
"wicked.test/portal-kong-adapter" \
"wicked.test/portal-auth"; do

if [ -d "../${wickedDir}" ]; then
echo "INFO: Updating ${wickedDir}"
Expand Down
Loading